본문 바로가기

아래로 스크롤 해주세요!

My Reference Book

-

제가 배웠던것을 한곳에 정리해보았어요!

HTML

HTML 태그 톺아보기

HTML

자세히보기

CSS

CSS 속성 톺아보기

CSS

자세히보기

JAVASCRIPT

JS 실행문 톺아보기

JAVASCRIPT

자세히보기

최신댓글

SITE 제작

헤더 타입 사이트 만들기~

by C0Di 2022. 9. 1.
728x90

헤더 영역 만들기!

피그마를 이용해 그리드를 생성 후 각 규격에 맞게 요소들을 구성합니다.


HTML 코드

웹 표준을 준수하기 위해 태그는 시멘틱 태그를 사용해 작성하며 효율적인 코드 작성을 위해 div태그를 여러개 만드는것이 아닌 한 태그안에 클래스를 다중으로 삽입합니다.

코드보기
<section id="headerType" class="header__wrap nexon">
    <div class="header__inner">
        <div class="header__logo">
            <a href="#">web <em>site</em></a>
        </div>
        <div 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>
        </div>
        <div class="header__member">
            <a href="#">로그인</a>
        </div>
    </div>
</section>

CSS코드

폰트는 'NexonLv1Gothic'를 이용하고 .card 클래스를 생성해 카드 Ui를 구현합니다.

코드보기
@import url('https://webfontworld.github.io/NexonLv1Gothic/NexonLv1Gothic.css');

.nexon {
    font-family: 'NexonLv1Gothic';
    font-weight: 400;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
}

a {
    text-decoration: none;
    color: #000;
}

img {
    width: 100%;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: normal;
}

em, i, address{
    font-style: normal;
}

/* common(공통) */
.container {
    width: 1160px;
    padding: 0 20px;
    margin: 0 auto;
}

.section {
    padding: 120px 0;
    /*위 아래 */
}

.section>h2 {
    /* ">" 이걸로 section 안에 있는 h2선택 */
    font-size: 50px;
    line-height: 1;
    /* 1이라고 적으면 auto랑 똑같음 */
    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: 16px;
}

.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;
}
.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__member{
    width: 20%;
    text-align: right;
}
.header__member a{
    font-size: 16px;
    border: 1px solid #000;
    padding: 10px 30px;
    border-radius: 50px;
    transition: all 0.25s;
}

.header__member a:hover{
    background-color: #000;
    color: #fff;
}

결과


728x90
반응형

댓글

#HASH_TAGS

-

1

오늘은 내가바로 오징어! ImageSlideEffect 이건 또 뭐람 슬라이드 결과 : 월요일 테스트 오늘 조업 마감했습니다. 공부 숙제가 다양해서 너무 좋아요 선택해주세요 테스트테스트 메서드 내일은 즐거운 월요일 오징어 한마리 수확 완료! 제이쿼리 화사한가요? JQuery 코드 울적하니 꽃을 달아봤습니다 다크모드 오징어 두마리 포획 완료 Method 코딩 scroll-snap-type HTML 멈추지 않는 ' j ' 시리-즈 오늘도 웹표준은.. 필터선택자 오징어 1Kg 당 3000원 scroll-snap-align