You are here: Re: inline vs. block « HTML « IT news, forums, messages
Re: inline vs. block

Posted by Andy Dingley on 03/30/06 04:08

On Wed, 29 Mar 2006 21:40:44 +0100, David Dorward <dorward@yahoo.com>
wrote:

>Stan McCann wrote:
>
>> How is a novice to tell the difference between an inline and block
>> level element?

Read the DTD

<!ENTITY % special
"A | IMG | OBJECT | BR | SCRIPT | MAP | Q | SUB | SUP | SPAN | BDO">

<!-- %inline; covers inline or "text-level" elements -->
<!ENTITY % inline "#PCDATA | %fontstyle; | %phrase; | %special; |
%formctrl;">

These have told us that SPAN is a member (indirectly) of %inline;

The following tells us that the content model _inside_ SPAN is also
%inline;

<!ELEMENT SPAN - - (%inline;)* -- generic language/style
container -->
<!ATTLIST SPAN
%attrs; -- %coreattrs, %i18n, %events --
%reserved; -- reserved for possible future use --
>

For P we see that it's %block;, but that its content model is %inline;

<!ENTITY % block
"P | %heading; | %list; | %preformatted; | DL | DIV | NOSCRIPT |
BLOCKQUOTE | FORM | HR | TABLE | FIELDSET | ADDRESS">

<!ELEMENT P - O (%inline;)* -- paragraph -->
<!ATTLIST P
%attrs; -- %coreattrs, %i18n, %events --
>


>The basic difference is that blocks have a line break before and after them,
>while inline flow beside each other and word wrap.

No, this is incorrect. That's the default CSS behaviour of the element
(confusingly also called "block" and "inline" which is not the same as
the HTML content model that control valid nesting.

We can change the CSS behavious at will with the display property. We're
stuck with the HTML DTD though.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация