본문 바로가기
컴퓨터자격증/웹디자인기능사

웹디자인기능사 실기 | 유형별 CSS 총정리

by KISCH 2022. 3. 19.
반응형

 

웹디자인기능사 실기 유형별로 메뉴, 슬라이드, 공지사항, 갤러리, 팝업창, 패밀리사이트에 대한 CSS를 모두 정리해봤습니다. 

 

 

메뉴

 

가로형 하단 전체 / 가로형 하단 개별 — CSS는 같고 jQuery 다릅니다.

header { width: 1200px; height: 100px; margin: 0 auto; }
section { width: 1200px; height: 500px; margin: 0 auto; }
footer { width: 1200px; height: 100px; margin: 0 auto; }

.nav_header {
    float: right; 				/* 네비 전체 우측 정렬 */
    width: 600px; height: 40px;
    margin-top: 30px;
}
.nav_header > ul > li {
    float: left; position: relative;		/* position */
    width: 150px; height: 40px;
    text-align: center; line-height: 40px;
}
.nav_header > ul > li:hover .mainMenu { color: #fff; background-color: #5b9bd5; }
.mainMenu {
    display: block;
    width: 100%; height: 40px;
    font-size: 18px; font-weight: bold;
}
.subMenu {
    position: absolute; 			/* position */
    width: 100%; height: 160px;
    top: 40px; z-index: 5000;
    background-color: #fff;
}
.subMenu li {
    width: 100%; height: 40px;
    text-align: center; line-height: 40px;
}
.subMenu li a {
    display: block;
    width: 100% height: 100%;
    font-size: 14px;
}
.subMenu li a:hover { color: #fff; background-color: #5b9bd5; }

 

가로형 하단 전체 배경  — 

.nav_header { 
    float: right; 
    width: 600px; height: 40px;
    margin-top: 60px;
}
.nav_header > ul  li { 
    float: left; position: relative; 
    width: 150px; height: 40px;
    text-align: center; line-height: 40px;
}
.nav_header > ul > li:hover .mainMenu { color: #fff; background-color: #5b9bd5; }
.mainMenu { 
    display: block; 
    width: 100%; height: 40px;
    font-size: 18px; font-weight: bold;
}
.subMenu { 
    position: absolute; 
    width: 100%; height: 120px;
    top: 40px; z-index: 5000; 
}
.subMenu li { 
    width: 100%; height: 40px;
    text-align: center; line-height: 40px;
}
.subMenu li a { 
    display: block; 
    width: 100%; height: 100%;
    font-size: 14px; color: #fff;
}
.subMenu li a:hover { 
    color: #333; 
    background-color: #ededed;
}
.subMenuBg { 
    position: absolute; 
    width: 100%; height: 120px;
    top: 100px; left: 0; z-index: 4000; 
    background-color: #5b9bd5;
}

 

세로형 하단 개별 — 

.nav_header { 
    width: 200kpx; overflow: hidden;
    padding: 20px; box-sizing: border-box;
}
.nav_header > ul > li { width: 100%; overflow: hidden; }
.nav_header > ul > li:hover .mainMenu { color: #f0e1b8; }
.mainMenu { 
    display: block; 
    width: 100%; height: 40px;
    line-height: 40px; text-align: center;
    color: #fff; font-weight: bold; font-size: 18px;
    border-bottom: 1px solid #fff;
}
.subMenu { 
    width: 100%; overflow: hidden;
    padding: 0 20px; box-sizing: border-box;
    background-color: #fff;
}
.subMenu li { 
    width: 100%; height: 30px;
    font-weight: bold; font-size: 12px; line-height: 39px; text-align: center;
}
.subMenu li a { display: block; }
.subMenu li a:hover { background-color: #344980; color: #fff; }

 

세로형 우측 개별 — 

.nav_header { 
    width: 200px; overflow: hidden;
    padding: 20px; box-sizing: border-box;
}
.nav_header > ul > li { width: 100%; overflow: hidden; }
.nav_header > ul > li:hover .mainMenu { color: #fff; background-color: hotpink; }
.mainMenu { 
    display: block; position: relative;				/* position */
    width: 100%; height: 40px;
    color: #000; font-weight: bold; font-size: 18px; line-height: 40px;
    border-bottom: 1px solid #000;
}
.subMenu { 
    display: none; position: absolute; 				/* position */
    width: 180px; height: 200px; z-index: 5000; 
    top: 100px; left: 180px;
    padding: 20px; box-sizing: border-box;
    background-color: hotpink;
}
.subMenu li { 
    width: 140px; height: 40px;
    font-weight: bold; font-size: 12px; line-height: 39px;
    border-bottom: 1px solid #000;
}
.subMenu li a { display: block; }				/* display */
.subMenu li a:hover { color: #fff; }

 

 

슬라이드

 

상하 슬라이드 — 

.slide { 
    overflow: hidden; position: relative;			/* positioin */
    width: px; height: px;  
}
.slide ul { 
    position: absolute; 					/* positioin */
    width: 100%; height: 슬라이드 높이 X 3 px;  
}
.slide li { 
    width: 100%; height: px;
    float: left; top: 0;
}

 

좌우 슬라이드 —

.slide { 
    overflow: hidden; position: relative; 		/* positioin */
    width: px; height: px; 
}
.slide ul { 
    position: absolute; 				/* positioin */
    width: 슬라이드넓이 X 3 px; height: px;
}
.slide li { 
    float: left; left: 0;
    width: px; height: px; 
}

 

페이드 인 / 아웃  — 

.slide { width: px; height: px; }
.slide ul { 
    position: relative; 			/* positioin */
    width: 100%; height: 100%;
}
.slide li { 
    display: none;
    position: absolute; top: 0; left: 0;	/* positioin */
    width: 100%; height: 100%;
} 
.slide li img { 
    display: block;
    width: 100%; height: 100%;
}

 

 

 

 

공지사항 / 팝업창 / 갤러리

 

공지사항 / 갤러리

공지사항 / 갤러리 탭구조 — 

.board {
    float: left;
    width: 400px; height: 200px;
}
.board .btn {
    width: 100%; height: 50px;
    border-bottom: 1px solid #999999;
}
.board .btn li {
    float: left; 
    height: 100%; 
    line-height: 49px; margin: 0 10px;
}
.board .btn li a {
    display: block;
    width: 100%; height: 100%;
    box-sizing: border-box;
    font-size: 18px; font-weight: bold; color: #999999;
}
.board .btn li.on a {
    color: #222328;
    border-bottom: 3px solid #222328;		/* border-bottom */
}
.board .btn .first { margin-left: 0;}
.bWrap > div { display: none; }			/* display: none */	

.notice { width: 100%; height: 150px; }
.notice li {
    width: 100%; height: 30px;
    line-height: 30px;
    font-size: 12px;
}
.notice li a {
    float: left; display: block;		/* float, dispaly*/
    width: 290px; height: 30px;
    padding-left: 10px; box-sizing: border-box;
    font-size: 12px;
}
.notice li .date {
    float: right; display: block;		/* float, dispaly*/
    width: 70px; height: 30px;
    padding-left: 10px; box-sizing: border-box;
    font-size: 12px; text-align: right;
}

 

공지사항 / 갤러리 세로형 탭구조 — 

/* 컨텐츠 */
.contents { width: 800px; height: 200px; }
.board {
    float: left;
    width: 400px; height: 200px;
    padding: 0 20px; box-sizing: border-box;
}
.board .btn {
    width: 100%; height: 50px;
    border-bottom: 1px solid #999999;
}
.board .btn li {
    float: left; margin: 0 10px;
    height: 100%; line-height: 49px;
}
.board .btn li a {
    display: block; 
    width: 100%; height: 100%;
    box-sizing: border-box;
    font-size: 18px; font-weight: bold; color: #999999;
}
.board .btn li.on a { color: #222328; border-bottom: 3px solid #222328; }
.board .btn .tab1 { margin-left: 0; }
.board .frame { width: 100%; height: 140px; }
.frame > div { display: none; }

/* 공지사항 */
.notice { width: 100%; height: 150px; }
.notice li { 
    width: 100%; height: 30px; 
    line-height: 30px; font-size: 12px;
}
.notice li a { 
    float: left; display: block; 
    width: 290px; height: 30px;
    padding-left: 10px; box-sizing: border-box;
    font-size: 12px;
}
.notice li .date { 
    float: right; display: block; 
    width: 70px; height: 30px;
    padding-right: 10px; box-sizing: border-box;
    font-size: 12px;
}

/* 갤러리 */
.gallery { width: 100%; height: 140px; }
.gallery ul { padding: 25px 0; }
.gallery li { 
    float: left; 
    width: 100px; height: 100px;
    margin: 0 10px;
}
.gallery li img { transition: 0.3s; }          
.gallery li a:hover img { opacity: 0.5; }

 

팝업창

일반레이어 — 

.popup { 
    display: none; position: fixed; 			/* position */
    width: 300px; height: 300px;
    top: 150px; left: 0; right: 0; margin: 0 auto; 	/* 가운데정렬 */
    padding: 10px;			
    border: 1px solid #999999;
    background-color: #fff;
}
.popup h2 { 
    height: 30px;
    font-size: 18px; line-height: 20px;
    margin-bottom: 10px;
    border-bottom: 1px solid #999999;
}
.popup p { font-size: 12px; }
.popup a { 
    display: block; position: absolute;			/* position */
    text-align: right;
    bottom: 10px; right: 10px;
}

 

모달레이어 — 

.popupBg {
    display: none; position: absolute;
    width: 100%; height: 100%;
    top: 0; left: 0; z-index: 10;
    background-color: rgba(0,0,0,0.5);
}

 

로고 / 카피라이트 / 푸터메뉴 / SNS / 패밀리사이트

 

로고 — 

footer h1 { 
    float: left; 
    width: 200px; height: 40px; 
    margin-top: 30px;
}

 

카피라이트  — 

footer p { 
    float: left; 
    width: px; height: px;
    margin-top: 25px; padding: 15px;
    font-size: 18px; text-align: center;
    box-sizing: border-box;
}

 

SNS — 

.sns {
    float: right;
    width: 200px; height: 50px;
    margin-top: 25px;
}
.sns ul {
    padding: 5px 15px;
}
.sns li {
    float: left;
    width: 35px; height: 100%;
    margin: 0 10px;
}

 

푸터 메뉴 — 

.nav_footer, footer p {
    float: left; 
    width: 600px; height: 50px;
    line-height: 50px; text-align: center;
}
.nav_footer li { 
    display: inline-block;					/* display */
}
.nav_footer li:after { 						/* li요소 뒤에 */
    content: '|'; 						/* content */
}
.nav_footer li:last-child { padding-right: 0; }
.nav_footer li:last-child:after { content: ''; }		/* content */

 

패밀리사이트 — 

.family { 
    float: right; position: relative;		/* position */
    width: 200px; height: 40px; 
}
.family button { 
    cursor: pointer; 				/* 커서 */
    border: 1px solid #999999; box-sizing: border-box;
    text-align: left; line-height: 38px;
    padding-left: 10px;
    width: 100%; height: 100%;
}
.family button .icon { 
    display: block; float: right; 
    padding-right: 10px;
}
.family ul { 
    display: none; 
    width: 100%; height: 120px;
    position: absolute; top: -120px; 		/* position */
    border: 1px solid #999999; border-bottom: none; 
    line-height: 29px; box-sizing: border-box;
    background-color: #fff; 
}
.family li { 
    width: 100%; height: 30px;
    padding-left: 10px;
    box-sizing: border-box; 
}

 

관련포스트 설명

 

정리

웹디자인기능사 실기 | 주요 코드 정리  가장 먼저 알아야할 코드들 설명입니다.

웹디자인기능사 실기 | 기본적인 와이어프레임 구조 — 전체적인 구조에 대한 html, css, javascript 소스입니다.

웹디자인기능사 실기 | 메뉴, 슬라이드, 본문 유형 — 다음 어떤 유형들이 있는지 알아야겠죠?

웹디자인기능사 실기 | 메뉴(네비게이션) 유형별 소스 — 메뉴에 대해 css, javascript를 디테일하게 살펴볼까요?

웹디자인기능사 실기 | 슬라이드 패턴  슬라이드에 대해서도 css, javascript를 살펴보겠습니다.

웹디자인기능사 실기 | 유형별 jQuery 총정리 — 메뉴, 슬라이드, 본문, 팝업, 푸터에 대해 javacsript(jQuery) 정리

 

문제풀이

웹디자인기능사 실기 | 문제 풀이 A-1 (JUST쇼핑몰)

웹디자인기능사 실기 | 문제 풀이 A-2 (Green 복지재단)

웹디자인기능사 실기 | 문제 풀이 A-3 (강원천문대)

웹디자인기능사 실기 | 문제 풀이 A-4 (유진건설)

웹디자인기능사 실기 | 문제 풀이 B-1 (대한은행)

웹디자인기능사 실기 | 문제 풀이 B-2 (대한투어)

웹디자인기능사 실기 | 문제 풀이 B-3 (세계의 미술작품)

웹디자인기능사 실기 | 문제 풀이 C-1 (해운대 빛축제)

웹디자인기능사 실기 | 문제 풀이 C-3 (남도맛기행 축제)

 

웹디자인기능사실기

반응형

댓글