The reason it works, as expected in the second section (without a div), but not in the first section, is caused by a counter. According to W3C :
, "counter- reset" .
html h3 h4 , counter-reset, h3, h4 . html h4 h3 s, , .
, counter-reset , 0 , counter-increment content, , ' 1 html:
"counter-increment" "content" , "counter- reset", , "counter- reset ' reset 0 .
div, :
HTML:
<div>
<h3>dddd</h3>
<h4>dddd</h4>
<h4>dddd</h4>
</div>
<div>
<h3>dddd</h3>
<h4>dddd</h4>
<h4>dddd</h4>
</div>
CSS:
body {
counter-reset: chapter;
}
http://jsfiddle.net/myajouri/QpG9d/