본문 바로가기

웹 표준 사이트 만들기/레이아웃 구조 실습

웹 표준 사이트 만들기 7강

반응형
SMALL

07.layout07.html 파일 생성

 

!(느낌표) 입력하고 Tab 누르면

 

html 기본 구조 자동 입력

 

언어에 ko 입력. 타이틀에 layout07 입력.

 

div 박스 4개 필요하다는 뜻

 

Tab 누르면 4줄 자동 입력

 

id 입력

 

style 입력하고 Tab 눌러서

 

style 선언

 

복붙

 

width 입력

 

height 입력

 

background 색상 임시로 입력

 

 

background 색상 임시 입력 후 미리보기

 

여백 없애기 'margin 0 padding 0' 입력

 

여백 없애기 'margin 0 padding 0' 입력 후 미리보기

 

확장 기능 ' indent Guides ' 을 다운받아

 

체크를 해주면

 

줄이 생긴다.

 

주석처리

 

id header top, id header nav 입력

 

레이아웃 주석처리, 복붙

 

width 값 height 값 입력

 

background 색상 복붙

 

background 색상 복붙 후 미리보기

 

header 입력

 

header 입력 후 미리보기

 

banner , 백그라운드 입력

 

 

banner , 백그라운드 입력 후 미리보기

 

header 백그라운드 생략 가능. 밑에 헤더가 색상을 감싸고 있기 때문이다.(음...??...무엇...)

 

#content1 입력하고 Tab 누르면

 

id 문장 자동 완성

 

Emmet 다운 되어 있으면 Ctrl + D 로 윗줄 복붙가능

 

 

class 입력

 

 

 

복붙

 

 

복붙 후 미리보기 1

 

 

복붙 후 미리보기 2

 

 

footer 입력

 

 

footer 입력 2

 

 

footer 입력 후 미리보기

 

 

width 기본값 100% 라 생략 가능(?). 임시 백그라운드 지우기

 

 

width, background 지움

 

 

폰트 크기,색상,위치 입력

 

 

폰트 크기,색상,위치 입력 후 미리보기

 

Line-height 입력

 

 

Line-height 입력 후 미리보기 1

 

 

Line-height 입력 후 미리보기 2. 완성!!

 

*tip*

 -전체적 쓰임은 id

 -세부적 쓰임은 class

<!DOCTYPE html>
<html lang="ko">
<head>
    <meta charset="UTF-8">
    <title>layout07</title>
    <style>
        /* 리셋 */
        * {margin: 0; padding: 0;}
        
        /* 전체 레이아웃 */
        #wrap {font-size: 20px; color: #fff; text-align: center;}
        #header {height: 140px; }
        #banner {height: 450px; background: #4dd0e1;}
        #contents {height: 950px;}
        #footer {height: 220px;}
        
        /* 레이아웃 */
        #header-top {height: 70px; line-height: 70px; background: #b2ebf2;}
        #header-nav {height: 70px; line-height: 70px; background: #80deea;}
        #content1 {height: 90px; line-height: 90px; background-color: #26c6da;}
        #content2 {height: 480px; line-height: 480px; background-color: #00bcd4;}
        #content3 {height: 380px; line-height: 380px; background-color: #00acc1;}
        #footer-nav {height: 60px; line-height: 60px; background-color: #0097a7;}
        #footer-info {height: 160px; line-height: 160px; background-color: #00838f;}
        
        /* 컨테이너 */
        .container {width: 1100px; margin: 0 auto; height: inherit; background: rgba(0,0,0,0.3);}
    </style>
</head>
<body>
    <div id="wrap">
        <div id="header">
            <div id="header-top">
                <div class="container">header-top</div>
            </div>
            <div id="header-nav">
                <div class="container">header-nav</div>
            </div>
        </div>
        <!-- //header -->
        
        <div id="banner">
                <div class="container">banner</div>
        </div>
        <!-- //banner -->
        
        <div id="contents">
            <div id="content1">
                <div class="container">content1</div>
            </div>
            <div id="content2">
                <div class="container">content2</div>
            </div>
            <div id="content3">
                <div class="container">content3</div>
            </div>
        </div>
        <!-- //contents -->
        <div id="footer">
            <div id="footer-nav">
                <div class="container">footer-nav</div>
            </div>
            <div id="footer-info">
                <div class="container">footer-info</div>
            </div>
        </div>
        <!-- //footer -->
    </div>
    <!-- //wrap -->
</body>
</html>

 

https://inf.run/Ks2S

https://inf.run/Ks2S

반응형
LIST