Anna Ghislaine (
garedeuropa) wrote in
getting_started2011-11-27 11:25 am
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
![[community profile]](https://www.dreamwidth.org/img/silk/identity/community.png)
Entry tags:
Centre-aligned journal with css
I'd like to have my journal centred horizontally. I find my journal's default layout too wide to read comfortably, so I used body {width:70%;} to narrow it. However, it won't budge from the left side of the screen. I've tried align:center, float:center, and auto left and right margins. Having it all on the left leaves a distracting block of white space on the right, so I'd much prefer the journal in the middle.
no subject
Instead, you want to set the width and margins on the first child div inside body, which is called #canvas.
So for your CSS:
#canvas { width: 70%; margin-left: auto; margin-right: auto; }
That ought to do it! :)
no subject