RE: display:inline-block;display: block;

Brian V Bonini wrote:
> But are not certain elements block by default, i.e., div, p. Or do they
> directly rely on the default state of the display property?

In CSS browsers, the display property is, by default, "inline." But before an other's stylesheet can affect this property, the browser's stylesheet is applied. In most browsers, this includes display: block; for elements like Div and P. Thus, for those tags, the default value is indeed inline, and the browser's base style is block.



MN-Venugopal wrote:
> The spec says inline-block is like block but it has no
> constraint to start from a new line. Can somebody explain the
> difference and the intentions of this.

Consider 2 Div tags one inside another:

<div>
<div id="test">
test
</div>
some text
</div>

Normally, the base-style display: block is applied to both divs. Thus div#test occupies its own vertical space in its container; it would render like this:

test
some text


However, if you modify div#test as:

div#test { display: inline-block; }


Then it now acts as a block (thus it can have attributes like width and height still applied, which an inline element cannot), but is allowed to sit inline. It renders:

test some text


-Chris "SoopahMan" Moschini
http://hiveminds.info/
http://soopahman.com/

(ignore attachment)
-------------------------------------------------------------------------------------

The information contained in this message is proprietary of Amdocs,

protected from disclosure, and may be privileged.

The information is intended to be conveyed only to the designated recipient(s)

of the message. If the reader of this message is not the intended recipient,

you are hereby notified that any dissemination, use, distribution or copying of 

this communication is strictly prohibited and may be unlawful. 

If you have received this communication in error, please notify us immediately

by replying to the message and deleting it from your computer.

Thank you.

-------------------------------------------------------------------------------------

Received on Friday, 27 June 2003 10:30:45 UTC