I was looking to integrate a Section with tabs into my page and found a good Tutorial to do this in pure CSS3 here http://t3n.de/news/css3-dynamische-tabs-ohne-365861/
With a working example: http://jsfiddle.net/6wcfH/
The basic structure of the HTML looks something like this:
<article class="infobox">
<section id="allgemeines">
<h2><a href="#allgemeines">Allgemeines</a></h2>
<p>Hier stehen ganz allgemeine Informationen.</p>
</section>
<section id="funktionen">
<h2><a href="#funktionen">Funktionen</a></h2>
<p>Hier stehen Informationen zu den Funktionen</p>
</section>
<section id="preise">
<h2><a href="#preise">Preise</a></h2>
<p>Hier stehen Informationen zu den Preisen.</p>
</section>
I just copied the code and changed the positioning of the entire thing to fit my page.
Now the links in the h2s get displayed as the tabs and clicking on them displays the according section.
My problem: right now this will jump in a way so that the h2 element will be displayed outside the field of vision (above). I am looking for a way to offset it so that I will jump to a position slightly higher.
So far I found ways to achieve this inserting spans into headlines and move the span higher and jump to that. I can however not apply that tactic since I want to jump to a section within the article and not some inline Element.
What would be a way to achieve an offset for a block, absolute-positioned Element without useing JavaScript but pure CSS?