Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The W3C doc doesn't use concepts like <em>wrong</em> and <em>sin</em>, but it does use those like <em>provide the means</em>, <em>may be appropriate</em> and <em>discouraged</em>.</p> <p>Actually, in the second paragraph of <a href="http://www.w3.org/TR/html401/conform.html" rel="noreferrer">section 4</a>, the 4.01 spec itemizes its words as follows</p> <blockquote> <p>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119]. However, for readability, these words do not appear in all uppercase letters in this specification.</p> </blockquote> <p>With that in mind, I believe the definitive statement is in <strong>7.5.3 Block-level and inline elements</strong>, where it says</p> <blockquote> <p>Generally, inline elements may contain only data and other inline elements.</p> </blockquote> <p>The condition "generally" appears to introduce enough ambiguity to say that HTML 4.01 does allow inline elements to contain block elements. </p> <p>Certainly, CSS2 has a display property value, <a href="http://www.w3.org/TR/CSS2/visuren.html#value-def-inline-block" rel="noreferrer">inline-block</a>, that appears to be suited to the purpose you describe. I'm not sure if it was ever widely supported, but it seems that someone anticipated the need for that kind of behavior.</p> <p>The DTD appear to be less forgiving here, but the <a href="http://www.w3.org/TR/REC-html40/sgml/dtd.html" rel="noreferrer">text of the DTD</a> defers to the spec:</p> <blockquote> <p>The HTML 4.01 specification includes additional syntactic constraints that cannot be expressed within the DTDs.</p> </blockquote> <p>In another comment, you suggest that you want to make a block active by wrapping it in an anchor. I don't believe HTML prohibits that, and CSS clearly allows it. So to answer the title question about whether it is ever correct, I say yes. By the standards, it is sometimes correct.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload