Hiya Sandy.

CSS can't create an HTML error: if your HTML is well-formed and valid, then
the resources it calls can have all sorts of inconsistencies and failings
that may affect the eventual whole package of the rendered page, but the
HTML itself will remain well-formed and valid.

Using CSS to instantiate a block level element nested inside an inline
element as you describe violates core concepts of the box model, and will
lead to erratic & unpredictable rendering, so I wouldn't recommend it.

Making traditionally inline elements display as block-level elements is not
a problem if their immediate container element is also block-level. So the
following examples, while exotic, will not cause errors layout errors:

<div>
<b style="display:block">
<b style="display:block">
 </b>
</b>
</div>

<ul>
 <li>
<a href="#" style="display:block">
</a>
 </li>
<li>
<a href="#" style="display:block">
 </a>
</li>
</ul>

Setting navigation links as block-level elements is particularly popular.

Regards,
Barney Carroll

barney.carr...@gmail.com
07594 506 381


On 13 January 2011 15:13, Colin (Sandy) Pittendrigh <
sandy.pittendr...@gmail.com> wrote:

> I found the following on the net:
>
> *Content model*
>
> Generally, block-level elements may contain inline
> elements and other block-level elements. *Generally, inline elements may
> contain
> only data and other inline elements.* Inherent in this structural
> distinction
> is the idea that block elements create “larger” structures than inline
> elements.
>
> I interpret that to mean "inline elements may not contain block elements."
>
> But with CSS and the display attribute we can change display from inline to
> block, or versa visa, for any element.  So, if my CSS says <b
> style="display: block;"> xx </b>, is that an error of any kind? And if so,
> it it an HTML error or a CSS error.  I tried to look this up W3.org, but
> I'm
> going to have to work on those grammar-like specifications.  They are not
> easy for beginners to read.
>
> --
>
> /*  Colin (Sandy) Pittendrigh  >--oO0> */
> ______________________________________________________________________
> css-discuss [css-d@lists.css-discuss.org]
> http://www.css-discuss.org/mailman/listinfo/css-d
> List wiki/FAQ -- http://css-discuss.incutio.com/
> List policies -- http://css-discuss.org/policies.html
> Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
______________________________________________________________________
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to