Quote:
Originally Posted by Psymon
Really? I have it in my style sheet in a couple of places, for example with centered paragraphs that I want to keep together as a block, or for tables, so that they'll center as well in the middle of the page "auto(matically)".
|
Most readers (all with Adobe engine, although it seems the latest incarnation behaves differently) just replace "auto" with "0", and this is an allowed behaviour according to specs. So just don't rely on "auto" being supported.
Quote:
So what would one do in a case like that? The width of the thing in question varies from place to place, so it's not like I could just specify a particular percentage or something.
|
Simple. Wrap your image in a <div> and center it:
Code:
<div class="ornament"><img alt="" src="../Images/ornament-black.jpg" /></div>
Code:
div.ornament {
text-align: center;
margin-top: 0.38em;
margin-bottom: 0.38em;
}
div.ornament img {
width: 38%;
}
PS. Don't use alt="Ornament", the alt text is supposed to be a replacement for the image (in text-to-speech, for example), and I don't think you want your image replaced with "ornament". For purely decorative images, such as this one, it's perfectly OK, and recommended, to just have an empty alt.