http://dr-haisook.blogspot.com/
My website is aligned to the center in Internet Explorer, while in Firefox it's aligned to the left.
I wonder: how can I center it in Firefox as well ?!![]()
http://dr-haisook.blogspot.com/
My website is aligned to the center in Internet Explorer, while in Firefox it's aligned to the left.
I wonder: how can I center it in Firefox as well ?!![]()
That's because IE is broken, and it's using the text-align property - which, as it's name suggests, applies to text and other in-line content - to affect the position of block-level elements.Originally Posted by Haisook
Block-level elements can be centred by applying a width or max-width property value other than auto, and setting auto left and right margins.
MikeCode:#container { margin: 0 auto; width: ??em; }
Thanks Mike, but...
Where exactly should I put these codes? [You can view my source]
Sorry, I'm not that experienced with HTML codes.
To use what I posted, you'll first have to create a wrapper element, with the id attribute value, container (though you could change that, obviously):
It's then just a matter of adding the rule in my previous post to your existing style sheet. You'll obviously need to alter the value for the width property; a value of around 40-50em should be fine.HTML Code:<div id="container"> <!-- The content you want centred --> </div>
Hope that helps,
Mike
Thanks
Bookmarks