Click to See Complete Forum and Search --> : width and height property not working for inline elements


mark_yieh
07-12-2006, 05:06 PM
Hi everyone. I'm trying to set a width and height property for an inline element and it doesn't seem to work. Any suggestions? Here is the code:


div {width: 100px; height: 100px; display: inline; border: 2px solid red;}


I put in the border property so you can see the width and height.

Thanks for reading

NogDog
07-12-2006, 06:01 PM
Height and Width apply to "all elements but non-replaced inline elements, table columns, and column groups" (http://www.w3.org/TR/CSS21/propidx.html), so they do not have any effect on in-line elements.

ray326
07-12-2006, 10:07 PM
A div with display:inline is a span.