[WEB4LIB] Re: specifying the width, in pixels, of a line of text
Kevin W Bishop
bishopk at rpi.edu
Fri Jan 7 15:13:43 EST 2005
-----Original Message-----
From: web4lib at webjunction.org
[mailto:web4lib at webjunction.org] On Behalf Of Justin Rounds
Sent: Friday, January 07, 2005 2:59 PM
To: Multiple recipients of list
Subject: [WEB4LIB] Re: specifying the width, in pixels, of a line of
text
It depends on which version of IE you're referring to -- IE5's
implementation of the box model was completely wrong, but IE6 seems to
be ok (at least I haven't had any width-related problems yet).
The box model specifies width as the width of the _content_ inside the
box, and does not refer to the box itself, e.g. a <div
style="width:200px;margin:10px;padding:10px"> would take up a 220px-wide
space on the page, *not* 200px. IE5 treats the width as being the width
of the box itself, so in the previous example the div would take up a
200px-wide space on the page, *not* 220px.
I know this is certainly the case with divs, but the rules may be
different for other block-level elements.
There are hacks to workarounds this, however. Look here for more
information:
http://www.info.com.ph/~etan/w3pantheon/style/abmh.html
You can read more about the box model here:
http://www.w3.org/TR/REC-CSS2/box.html
____________________________
If you don't declare a doctype, IE6 will go into "quirks mode"
(technical term) and continue to display the wrong box model behavior.
A fuller explanation, including box model hacks, can be found here:
http://www.positioniseverything.net/articles/box-model.html
To the original question: have you tried specifying the width of a
containing div for the images (left and right) and contained text?
Actually, you probably want to define the min-width but, again, IE
doesn't cooperate with us here.
Hope this helps.
-kb
___________________________
Kevin W. Bishop > bishopk at rpi.edu
Communication & Collaboration Technologies
Rensselaer Polytechnic Institute > http://www.rpi.edu/
RPInfo: http://www.rpi.edu/rpinfo/
More information about the Web4lib
mailing list