Colin (Sandy) Pittendrigh wrote:

I interpret that to mean "inline elements may not contain block
elements."

That’s a correct conclusion regarding HTML markup. But it is a purely syntactic matter and as such completely external to CSS. You could apply CSS, for example, on a basic XML file with no document type definition, no nesting rules (apart from generic XML well-formedness constraints), with no such concept as “inline element” or “block element.”

The HTML and CSS concepts (of “inline” and “block”) are independent of each other. There’s just the connection that when a CSS stylesheet is applied to an HTML document, certain HTML elements will have display: block by default. This can be characterized as applying default stylesheet.

But with CSS and the display attribute we can change display from
inline to block, or versa visa, for any element.

Yes, and you can do such things e.g. for CSS to be applied to a basic XML file (where all elements have display: inline unless you set otherwise).

So, if my CSS says
<b style="display: block;"> xx </b>, is that an error of any kind?

It does not violate any HTML or CSS specification. Whether it is an error or somehow questionable as a pragmatic issue is debatable. If you ask me, I would say that authors should usually avoid setting the display property of an HTML element to something that is not in harmony with its nature and properties as defined in HTML. But I wouldn’t go as far as saying that such settings are always wrong. For example, it is a common trick to set display: block for an image to avoid some undesired browser behavior.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
______________________________________________________________________
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