Skip to content

Instantly share code, notes, and snippets.

@topokel
Created October 3, 2013 06:35
Show Gist options
  • Select an option

  • Save topokel/6805897 to your computer and use it in GitHub Desktop.

Select an option

Save topokel/6805897 to your computer and use it in GitHub Desktop.
Fixed header anchor fix
/*
* set 60px to whatever height your navbar is
* This works on any selector as long as you
* give it the :before pseudo-selector.
*
*/
div[id]:before{
display: block;
content: ""; /* IE fix I really forgot what for */
height: 60px;
margin: -60px 0 0; /* make sure to make the height negative here */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment