Looking to create a navigation bar using CSS
Markup:
<nav>
Navigation content
</nav>
<div id="mainContent">
Main page content
</div>
CSS:
nav {
position:fixed;
height: X%;
min-height: Ypx;
}
#mainContent {
margin-top: Z; // where Z represents the height of nav (X% or Ypx)
}
I understand that jQuery provides a solution, but I am currently focusing on mastering pure CSS. My plan is to move on to Stylus and Nib in Meteor.... So, I'm wondering if there is a CSS-centric approach available?
Is it possible to calculate element heights within the stylesheet, even if utilizing Stylus?