remove extra divs for hamburger nav
This commit is contained in:
parent
6b08ca1df7
commit
4124b88b42
14
account.html
14
account.html
@ -13,14 +13,12 @@
|
||||
<body>
|
||||
<header>
|
||||
<h1>tronnet</h1>
|
||||
<nav id="hamnav">
|
||||
<label for="hamburger">☰</label>
|
||||
<input type="checkbox" id="hamburger">
|
||||
<div id="hamitems">
|
||||
<a href="index.html">Instances</a>
|
||||
<a href="account.html" aria-current="true">Account</a>
|
||||
<a href="login.html">Logout</a>
|
||||
</div>
|
||||
<label for="navtoggle">☰</label>
|
||||
<input type="checkbox" id="navtoggle">
|
||||
<nav>
|
||||
<a href="index.html">Instances</a>
|
||||
<a href="account.html" aria-current="true">Account</a>
|
||||
<a href="login.html">Logout</a>
|
||||
</nav>
|
||||
</header>
|
||||
<main>
|
||||
|
14
config.html
14
config.html
@ -14,14 +14,12 @@
|
||||
<body>
|
||||
<header>
|
||||
<h1>tronnet</h1>
|
||||
<nav id="hamnav">
|
||||
<label for="hamburger">☰</label>
|
||||
<input type="checkbox" id="hamburger">
|
||||
<div id="hamitems">
|
||||
<a href="index.html" aria-current="true">Instances</a>
|
||||
<a href="account.html">Account</a>
|
||||
<a href="login.html">Logout</a>
|
||||
</div>
|
||||
<label for="navtoggle">☰</label>
|
||||
<input type="checkbox" id="navtoggle">
|
||||
<nav>
|
||||
<a href="index.html" aria-current="true">Instances</a>
|
||||
<a href="account.html">Account</a>
|
||||
<a href="login.html">Logout</a>
|
||||
</nav>
|
||||
</header>
|
||||
<main>
|
||||
|
20
css/nav.css
20
css/nav.css
@ -39,23 +39,23 @@ nav {
|
||||
font-size: larger;
|
||||
}
|
||||
|
||||
nav a, header h1, nav label {
|
||||
nav a, header h1, label[for="navtoggle"] {
|
||||
text-align: left;
|
||||
padding: 8px 10px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#hamnav label, #hamburger {
|
||||
label[for="navtoggle"], #navtoggle {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 600px){
|
||||
#hamitems a:hover, #hamitems a[aria-current="true"], #hamitems:hover a[aria-current="true"]:hover {
|
||||
nav a:hover, nav a[aria-current="true"], nav:hover a[aria-current="true"]:hover {
|
||||
color: var(--nav-link-active-text-color);
|
||||
background-color: var(--nav-link-active-bg-color);
|
||||
}
|
||||
|
||||
#hamitems:hover a[aria-current="true"] {
|
||||
nav:hover a[aria-current="true"] {
|
||||
color: var(--nav-text-color);
|
||||
background-color: var(--nav-bg-color);
|
||||
}
|
||||
@ -65,7 +65,7 @@ nav a, header h1, nav label {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#hamitems {
|
||||
nav {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
@ -76,7 +76,7 @@ nav a, header h1, nav label {
|
||||
grid-template-columns: 1fr auto;
|
||||
}
|
||||
|
||||
#hamitems {
|
||||
nav {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 43px;
|
||||
@ -84,18 +84,18 @@ nav a, header h1, nav label {
|
||||
background-color: var(--nav-bg-color);
|
||||
}
|
||||
|
||||
#hamitems a {
|
||||
nav a {
|
||||
box-sizing: border-box;
|
||||
display: block;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#hamnav label {
|
||||
label[for="navtoggle"] {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
#hamburger ~ #hamitems a {
|
||||
#navtoggle ~ nav a {
|
||||
height: 0;
|
||||
padding: 0 0.5em;
|
||||
border: 0;
|
||||
@ -103,7 +103,7 @@ nav a, header h1, nav label {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
#hamburger:checked ~ #hamitems a {
|
||||
#navtoggle:checked ~ nav a {
|
||||
height: 2.5em;
|
||||
padding: 0.5em;
|
||||
transition: height 250ms cubic-bezier(0.23, 1, 0.32, 1);
|
||||
|
14
index.html
14
index.html
@ -15,14 +15,12 @@
|
||||
<body>
|
||||
<header>
|
||||
<h1>tronnet</h1>
|
||||
<nav id="hamnav">
|
||||
<label for="hamburger">☰</label>
|
||||
<input type="checkbox" id="hamburger">
|
||||
<div id="hamitems">
|
||||
<a href="index.html" aria-current="true">Instances</a>
|
||||
<a href="account.html">Account</a>
|
||||
<a href="login.html">Logout</a>
|
||||
</div>
|
||||
<label for="navtoggle">☰</label>
|
||||
<input type="checkbox" id="navtoggle">
|
||||
<nav>
|
||||
<a href="index.html" aria-current="true">Instances</a>
|
||||
<a href="account.html">Account</a>
|
||||
<a href="login.html">Logout</a>
|
||||
</nav>
|
||||
</header>
|
||||
<main>
|
||||
|
10
login.html
10
login.html
@ -13,12 +13,10 @@
|
||||
<body>
|
||||
<header>
|
||||
<h1>tronnet</h1>
|
||||
<nav id="hamnav">
|
||||
<label for="hamburger">☰</label>
|
||||
<input type="checkbox" id="hamburger">
|
||||
<div id="hamitems">
|
||||
<a href="login.html" aria-current="true">Login</a>
|
||||
</div>
|
||||
<label for="navtoggle">☰</label>
|
||||
<input type="checkbox" id="navtoggle">
|
||||
<nav>
|
||||
<a href="login.html" aria-current="true">Login</a>
|
||||
</nav>
|
||||
</header>
|
||||
<main class="flex" style="justify-content: center; align-items: center;">
|
||||
|
Loading…
Reference in New Issue
Block a user