I noticed this (weirdness?) When playing with code related to a: link around div - styling inside div
Given this HTML:
<a id="foo" href="foobar"> <div id="bar"> <h2 id="baz">Foo</h2> </div> </a>
And this CSS (background colors added to show the structure):
a { display: block; padding: 20px; background-color: rgb(240,240,240); } #bar { width: 200px; height: 100px; background-color: rgb(220,220,220); } #baz { padding: 20px; text-decoration: none; }
Fiddle
Chrome shows the corresponding CSS rules as containing text-decoration: none; but the text is really underlined:

(source: pangram.net )
Similarly, using Firebug, Firefox returns null for the computed textDecoration style:

(source: pangram.net )
MDN says text-decoration applies to all elements .
I understand that there is a simple workaround - just apply the text-decoration property to the a link, but this is not the behavior I expected. Can someone explain this (apparent) mismatch?
Edit: I suppose the answer is here: Line Design: Underlined, Underlined and Strikethrough
When specified or extended to a container block that establishes an inline formatting context, decorations extend to an anonymous inline field that wraps all incoming children of the inline level of the container block.
But I still do not fully understand what is happening.
source share