Does the CSS block attribute affect HTML well-formedness?

Posted by tibbe on Stack Overflow See other posts from Stack Overflow or by tibbe
Published on 2010-03-22T08:30:53Z Indexed on 2010/03/22 8:41 UTC
Read the original article Hit count: 523

Filed under:
|
|
|

An HTML <body> element can only contain block elements such as <p>. If I declare an inline element such as <span> to be display: block using CSS does that make the following HTML well-formed?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  <head>
    <title>Title</title>
  </head>
  <body>
    <span style="display: block;">Hi!</span>
  </body>
</html>

© Stack Overflow or respective owner

Related posts about html

Related posts about XHTML