Chrome anchor issue
Demo on Chrome buggy behavior for absolutely placed anchors without content
HTML
<div>
<a href="#a1">a1 - should jump to BLUE but jumps to GREY</a>
<br/>
<a href="#a2">a2 - jumps to the page bottom instead of GREY</a>
<br>Also, if you remove the DIV wrapping these 2 links+text (not the "anchor-wrapper" div), the behavior is broken even further. Removing the comment in CSS resolves the issue, as well as putting any text into anchors.
</div>
<div class="anchor-wrapper" style="top:400px; background-color:blue;">
<a id="a1" name="a1"></a>
</div>
<div class="anchor-wrapper" style="top:800px; background-color:gray;">
<a id="a2" name="a2"></a>
</div>
CSS
body { height:2000px; }
.anchor-wrapper {
position:absolute;
width:32px;
height:16px;
}
.anchor-wrapper a:before {
/*content:"";*/ /* enabling this fixes the behavior, as well as putting any content into anchors or their wrappers */
}