W3C home > Mailing lists > Public > www-style@w3.org > June 2003

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

From: Chris Moschini <Chris.Moschini@amdocs.com>
Date: Fri, 27 Jun 2003 09:29:48 -0500
Message-ID: <3DB269E1BEC8134084EAA64AD4A1E0CF04C85E@stlmail1.corp.amdocs.com>
To: "'MN Venugopal-A18623'" <venugopal@motorola.com>, www-style@w3.org
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:22 GMT