<header class="header">
<div class="header__layout">
<h1 id="hamburger-logo" class="header__logo">
<a href="#">ここにロゴ</a>
</h1>
<nav id="hamburger-nav" class="header__nav">
<ul class="header__menus">
<li class="header__menu">
<a href="#">メニュー</a>
</li>
<li class="header__menu">
<a href="#">メニュー</a>
</li>
<li class="header__menu">
<a href="#">メニュー</a>
</li>
<li class="header__menu">
<a href="#">メニュー</a>
</li>
</ul>
</nav>
</div>
</header>
/* リセットCSS */
a {
color: inherit;
text-decoration: none;
}
ul {
margin: 0;
padding: 0;
list-style: none;
}
/* ヘッダーで使用 */
.header {
position: fixed;
z-index: 10;
top: 0;
left: 0;
width: 100%;
height: 100px;
background-color: #5CC0EF;
}
.header__layout {
display: flex;
justify-content: space-between;
align-items: center;
height: inherit;
margin: 0 auto;
padding: 0 20px;
}
.header__logo {
position: relative;
z-index: 12;
}
.header__logo a {
font-size: 24px;
color: #fff;
}
.header__nav {
height: inherit;
}
@media screen and (max-width: 767px) {
.header__nav {
display: none;
}
}
.header__menus {
display: flex;
justify-content: center;
align-items: center;
gap: 40px;
height: inherit;
}
.header__menu {
height: inherit;
}
.header__menu a {
display: flex;
align-items: center;
justify-content: center;
height: inherit;
font-size: 18px;
color: #fff;
transition: all 0.3s;
}
.header__menu a:hover {
color: #ffe100;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.