HTML tag 메뉴바 태그
전형적인 메뉴바 만들기
일반적으로 메뉴바는 <header/>과 <nav/> 태그를 이용해서 마크업을 많이 합니다. 실제로는 <ul/>, <li/>, <a/> 태그를 이용해서 다른 웹페이지로 이동이 가능한 메뉴 목록을 만들어야 하지만 최대한 간단한 예제를 위해서 <span/> 태그만을 사용하였습니다.
<header>
<h1>Brand</h1>
<nav>
<span>Menu1</span>
<span>Menu2</span>
<span>Menu3</span>
</nav>
</header>
헤더 영역에 대한 스타일도 메인 영역과 시작적으로 구분이 될 수 있을 정도로만 간단히 합니다.
header {
height: 75px;
padding: 1rem;
color: white;
background: teal;
font-weight: bold;
display: flex;
justify-content: space-between;
align-items: center;
}
index_html&css
<style>
header {
height: 75px;
padding: 1rem;
color: white;
background: teal;
font-weight: bold;
display: flex;
justify-content: space-between;
align-items: center;
}
</style>
<header>
<h1>Brand</h1>
<nav>
<span>Menu1</span>
<span>Menu2</span>
<span>Menu3</span>
</nav>
<1-- index_html&css P 잔뇨13時49分 스타일 완성52分----->
<style>
header {
height: 75px;
padding: 1rem;
color: white;
background: teal;
font-weight: bold;
display: flex;
justify-content: space-between;
align-items: center;
}
h1, p {
margin: 0;
}
main {
padding: 1rem;
height: 100%;
}
body {
background: #EEE;
}
body, html {
height: 200%;
}
* {
box-sizing: border-box;
}
<style>
<header>
<h1>Brand</h1>
<nav>
<span>Menu1</span>
<span>Menu2</span>
<span>Menu3</span>
</nav>
</header>
<main>
<p>This is the main area.</p>
<p>This is the main area.</p>
<p>This is the main area.</p>
<p>This is the main area.</p>
<p>This is the main area.</p>
<p>This is the main area.</p>
<p>This is the main area.</p>
<p>This is the main area.</p>
<p>This is the main area.</p>
<p>This is the main area.</p>
</main>
<!---------
https://www.daleseo.com/css-position-fixed-navigation/
<style>
header {
height: 75px;
padding: 1rem;
color: white;
background: teal;
font-weight: bold;
display: flex;
justify-content: space-between;
align-items: center;
}
h1, p {
margin: 0;
}
main {
padding: 1rem;
height: 100%;
}
body {
background: #EEE;
}
body, html {
height: 200%;
}
* {
box-sizing: border-box;
}
<style>
<header>
<h1>Brand</h1>
<nav>
<span>Menu1</span>
<span>Menu2</span>
<span>Menu3</span>
</nav>
</header>
<main>
<p>This is the main area.</p>
<p>This is the main area.</p>
<p>This is the main area.</p>
<p>This is the main area.</p>
<p>This is the main area.</p>
<p>This is the main area.</p>
<p>This is the main area.</p>
<p>This is the main area.</p>
<p>This is the main area.</p>
<p>This is the main area.</p>
</main>
HTML tag 메뉴바 태그
첫댓글 https://www.w3schools.com/html/tryit.asp?filename=tryhtml_default