デモサイトはこちら
完成データダウンロード
完成コード
HTML
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="./reset.css">
<link rel="stylesheet" href="./style.css">
<title>シンプルなヘッダーメニュー</title>
</head>
<body>
<header class="header_main">
<h1 class="logo">
<a href="">LOGO</a>
</h1>
<nav class="menu_pc">
<ul>
<li><a href="">HOME</a></li>
<li><a href="">NEWS</a></li>
<li><a href="">BLOG</a></li>
<li><a href="">ABOUT</a></li>
<li><a href="">CONTACT</a></li>
</ul>
</nav>
</header>
</body>
</html>
style.css
.header_main{
padding: 0 20px;
height: 80px;
display: flex;
justify-content: space-between;
background:
.logo{
height: 100%;
a{
padding-left: 20px;
height: 100%;
display: flex;
align-items: center;
font-size: 28px;
color:
}
}
nav.menu_pc{
height: 100%;
@media (max-width: 1040px){
display: none;
}
ul{
height: 100%;
display: flex;
li{
height: 100%;
a{
padding: 0 20px;
height: 100%;
display: flex;
align-items: center;
color:
transition: .3s;
&:hover{
background:
}
}
}
}
}
}
reset.css
html,
body,
div,
span,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "Arial", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "ヒラギノ角ゴ ProN W3", "Yu Gothic", "YuGothic", "Meiryo", sans-serif;
color: #000000 ;
font-weight: 400;
font-style: normal;
letter-spacing: 0.05em;
overflow-x: hidden;
}
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
display: block;
}
ul {
list-style: none;
}
blockquote,
q {
quotes: none;
}
blockquote:before,
blockquote:after,
q:before,
q:after {
content: "";
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
input[type="submit"],
input[type="button"] {
border-radius: 0;
-webkit-box-sizing: content-box;
-webkit-appearance: button;
appearance: button;
border: none;
box-sizing: border-box;
cursor: pointer;
}
select {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
background: #fff ;
color: #000 ;
}
*,
*:before,
*:after {
box-sizing: border-box;
}
img {
vertical-align: top;
}
input,
select {
vertical-align: middle;
}
hr {
display: block;
height: 1px;
border: 0;
border-top: 1px solid #cccccc ;
margin: 1em 0;
padding: 0;
}
a {
margin: 0;
padding: 0;
font-size: 100%;
vertical-align: baseline;
background: transparent;
text-decoration: none;
}
a[x-apple-data-detectors] {
color: inherit !important;
text-decoration: none !important;
font-size: inherit !important;
font-family: inherit !important;
font-weight: inherit !important;
line-height: inherit !important;
}
html[theme='dark-mode'] {
filter: invert(1) hue-rotate(180deg);
}
abbr[title],
dfn[title] {
border-bottom: 1px dotted;
cursor: help;
}