Is it correct HTML to change the color of text inside a H1, H2, H3 or H4 element? Are they block level?
For example
<h1><span style="color:#ABAB">#500</span> Hello world</h1>
They are block elements.
If you look at the HTML 4.01 strict DTD:
<!ENTITY % heading "H1|H2|H3|H4|H5|H6"> <!ENTITY % block "P | %heading; | %list; | %preformatted; | DL | DIV | NOSCRIPT | BLOCKQUOTE | FORM | HR | TABLE | FIELDSET | ADDRESS">
So, they are all defined as %heading
entities, which in turn are part of the %block
entities.
As for the question regarding if you can change the color - that's just styling and is fine, though I would do so in a CSS file, not inline:
H1, H2, H3, H4, H5, H6 { color: #ccccc; }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With