Skip to content

Instantly share code, notes, and snippets.

@webbyworks
Created September 25, 2014 20:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webbyworks/f34015cf3b22b5d28fdc to your computer and use it in GitHub Desktop.
Save webbyworks/f34015cf3b22b5d28fdc to your computer and use it in GitHub Desktop.
Inline style tags with nav bar html. Responsive nav.
<!DOCTYPE html>
<html>
<head>
<style>
header .logo { float: left }
.main-nav { display: none }
.main-nav a { text-transform: uppercase; display: inline-block; margin: 1em; border-bottom: 1px solid; }
.main-nav ul li { list-style-type: none; display: inline; }
.main-nav ul { clear: both; background-color: white; }
.showMenu, .hideMenu { font-size: 2.5em; float: right; }
.showMenu { display: inline-block }
.hideMenu { display: none }
.hideMenu:target { display: none }
.showMenu:target + .hideMenu { display: inline-block }
.showMenu:target { display: none }
.showMenu:target ~ .main-nav { display: inline }
</style>
</head>
<body>
<header>
<a href="/" class="logo">Me</a>
<a href="#showMenu" class="showMenu" id="showMenu">≡</a>
<a href="#hideMenu" class="hideMenu" id="hideMenu">×</a>
<nav class="main-nav">
<ul><li><a href="/my-link-1/">Link 1</a><li>
<li><a href="/my-link-2/">Link 2</a></li></ul>
</nav>
</header>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment