본문 바로가기
광고 준비 중
사이트 | 레이아웃

[사이트] 헤더 유형 01

by 탈코딩 2022. 9. 2.
728x90
반응형

 

 

 

사이트 만들기

헤더 유형 사이트 만들기 01 입니다.
피그마로 먼저 형태를 잡고 HTML과 CSS문서를 만들었습니다.


HTML

로고 영역과 메뉴 영역 로그인 버튼이 있습니다.
<section id="headerType" class="header__wrap nexon">
    <div class="header__inner">
        <div class="header__logo">
            <a href="">web<em>site</em></a>
        </div>
        <nav class="header__menu">
            <ul>
                <li><a href="">헤더 영역</a></li>
                <li><a href="">슬라이드 영역</a></li>
                <li><a href="">배너 영역</a></li>
                <li><a href="">컨텐츠 영역</a></li>
                <li><a href="">푸터 영역</a></li>
            </ul>
        </nav>
        <div class="header__mamber">
            <a href="">로그인</a>
        </div>
    </div>
</section>

CSS

메뉴와 로그인 버튼에 오버 효과를 줬습니다.

<style>
/* fonts */
@import url('https://webfontworld.github.io/gmarket/GmarketSans.css');
.gowun {
    font-family: GowunBatang;
    font-weight: 400;
}
/* reset */
* {
    margin: 0;
    padding: 0;
}
a {
    text-decoration: none;
    color: #000;
}
img {
    width: 100%;
    vertical-align: top;
}
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: normal;
}
em,
i,
address {
    font-style: normal;
}
/* ir 효과(이미지 대체 효과 == alt) */
.ir {
    display: block;
    overflow: hidden;
    font-size: 0;
    line-height: 0;
    text-indent: -9999px;
}
/* common */
.container {
    width: 1160px;
    padding: 0 20px;
    margin: 0 auto;
    min-width: 1160px;
}
.container-fluid {
    width: 100%;
    padding: 0 100px;
    box-sizing: border-box;
}
.section {
    padding: 120px 0;
}
.section>h2 {
    font-size: 50px;
    line-height: 1;
    text-align: center;
    margin-bottom: 20px;
}
.section>p {
    font-size: 22px;
    font-weight: 300;
    color: #666;
    text-align: center;
    margin-bottom: 70px;
}
.section>span {
    display: block;
    text-align: center;
    font-size: 16px;
    text-decoration: underline;
    margin-bottom: 10px;
}
.mb70 {
    margin-bottom: 70px !important;
}
/* headerType */
.header__inner {
    width: 100%;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-sizing: border-box;
    border-bottom: 1px solid #ccc;
}
.header__logo {
    width: 20%;
    font-size: 30px;
    font-weight: 700;
    text-transform: uppercase;
}
.header__logo em {
    font-size: 18px;
    font-weight: 400;
    font-style: normal;
}
.header__menu {
    width: 60%;
    text-align: center;
}
.header__menu li {
    display: inline;
}
.header__menu li a {
    padding: 13px 30px;
    margin: 0 5px;
    transition: background-color 0.3s;
}
.header__menu li a:hover {
    background-color: #f1f1f1;
    border-radius: 5px;
}
.header__mamber {
    width: 20%;
    text-align: right;
}
.header__mamber a {
    font-size: 16px;
    border: 1px solid #000;
    padding: 10px 30px;
    border-radius: 50px;
    transition: background-color 0.3s;
}
.header__mamber a:hover {
    background-color: #000;
    color: #fff;
}
</style>

결과

728x90
반응형

댓글