Is there a way to have am Image always centered (using different resolutions) using CSS if so do I use relative or static or another ?
Is there a way to have am Image always centered (using different resolutions) using CSS if so do I use relative or static or another ?
May I refer you to http://www.w3.org/Style/Examples/007/center.html#block.
The way I understand it, apply AUTO left/right margins (margin-left: auto; margin-right; or margin: 0 auto. Then. because IE doesn't support AUTO margins, add text-align: center; (usually in body specs, and then apply text-align: left; for content div).
Frankly, I wish they would reinstate good old, no-nonsense CENTER.
Code:<div style="text-align:center;"> <img src="myimage.jpg" alt="text"> </div>
- Mike
Thanks ...that worked well
We don't -- that there scurvy dog be bulk presentational markupFrankly, I wish they would reinstate good old, no-nonsense CENTER.It's not as simple as that. One centres a block-level element by making sure its left and right margins are equal and of the correct width to hold the element in the centre (which is what the margin:auto stuff is all about). However, images are inline elements, and so should be centred with text-align:center. Then IE comes along and treats certain elements (specifically, tables) as if they were inline, even though they're actually block-level, so we have to centre those with text-align as well.The way I understand it, apply AUTO left/right margins (margin-left: auto; margin-right; or margin: 0 auto. Then. because IE doesn't support AUTO margins, add text-align: center; (usually in body specs, and then apply text-align: left; for content div).
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
Bookmarks