flex로 시멘틱 태그만들기
<!DOCTYPE html>
<html lang="en">
<head>
<title>연습문제- flex로 시멘틱 태그만들기</title>
<style>
* {
margin: 0;
padding: 0;
text-align: center;
}
#wrap {
display: flex;
flex-direction: column;
width: 100%;
min-width: 760px;
max-width: 1080px;
margin: 0 auto;
}
#header {
background-color: purple;
height: 10%;
}
#nav {
background-color: green;
height: 10%;
}
#main {
display: flex;
flex: 1;
}
#section {
background-color: teal;
width: 70%;
height: 300px;
line-height: 300px;
}
#aside {
background-color: orange;
width: 30%;
height: 300px;
line-height: 300px;
}
#footer {
background-color: brown;
height: 10%;
}
.box {
text-align: center;
color: white;
line-height: 50px;
}
</style>
</head>
<body>
<div id="wrap">
<div class="box" id="header">Header</div>
<div class="box" id="nav">Nav</div>
<div class="box" id="main">
<div class="box" id="section">Section</div>
<div class="box" id="aside">Aside</div>
</div>
<div class="box" id="footer">Footer</div>
</div>
</body>
</html>
실습 - 카카오톡 로그인 화면 만들기
<!DOCTYPE html>
<html lang="ko">
<head>
<title>연습문제 - 다음로그인화면을 구현하시오.</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: Arial, sans-serif;
}
#wrap {
width: 580px;
height: 600px;
margin: auto;
border: 1px solid #ddd;
padding: 20px;
background-color: #fff;
}
header {
width: 100%;
height: 170px;
text-align: center;
font-size: 35px;
line-height: 220px;
}
#main input[type="text"] {
margin-top: 30px;
}
#main input[type="text"],
#main input[type="password"] {
width: 80%;
height: 40px;
margin-bottom: 10px;
border: none;
border-bottom: 2px solid #ddd;
color: #c4c4c4;
font-size: 18px;
margin-left: 10%;
}
#main input[type="text"]:focus,
#main input[type="password"]:focus {
border-color: #aaa;
}
.custom-checkbox {
display: none;
}
.custom-checkbox+span {
position: relative;
padding-left: 30px;
cursor: pointer;
}
.custom-checkbox+span::before {
content: "";
position: absolute;
left: 5px;
top: 0;
width: 15px;
height: 15px;
border: 2px solid #999999;
border-radius: 50%;
background-color: #fff;
}
.custom-checkbox:checked+span::before {
background-color: #fee500;
border-color: #333;
}
.custom-checkbox:checked+span::after {
content: "";
position: absolute;
left: 7px;
top: 7px;
width: 6px;
height: 6px;
background-color: #ff0000;
border-radius: 50%;
}
.keep_status {
color: #666;
display: flex;
float: left;
align-items: center;
justify-content: center;
margin: 15px 10%;
}
.keep_status input[type="checkbox"] {
margin-right: 5px;
}
.keep_status span {
font-size: 14px;
}
.keep_status button {
background-color: transparent;
width: 18px;
height: 18px;
background-image: url("./ico_comm.png");
background-size: 300px 300px;
background-position: -120px -110px;
border-width: 0px;
cursor: pointer;
margin-left: 5px;
}
#main input[type="submit"] {
width: 80%;
height: 50px;
background-color: #fee500;
border: none;
font-size: 16px;
border-radius: 3px;
color: #333;
cursor: pointer;
margin-left: 10%;
margin-top: 30px;
}
#main input[type="submit"]:hover {
background-color: #f0d800;
}
.line {
position: relative;
text-align: center;
font-size: 12px;
color: #888;
margin: 20px 0;
}
.line::before,
.line::after {
content: "";
display: inline-block;
width: 35%;
height: 1px;
background-color: #ddd;
vertical-align: middle;
}
.line::before {
margin-right: 10px;
}
.line::after {
margin-left: 10px;
}
#main input[type="button"] {
width: 80%;
height: 50px;
background-color: #f5f5f5;
border: none;
font-size: 16px;
color: #333;
border-radius: 3px;
cursor: pointer;
margin-left: 10%;
}
.bottom {
display: flex;
width: 80%;
margin-left: 10%;
justify-content: space-between;
margin-top: 25px;
font-size: 16px;
}
.bottom a {
height: 100%;
float: right;
}
.list_user {
width: 50%;
list-style: none;
float: left;
text-align: right;
}
.list_user a {
margin-left: 10px;
}
.list_user>li:last-child>a {
border-right: 1px solid #ddd;
height: 10px;
padding-right: 10px;
}
a {
text-decoration: none;
color: #333;
font-size: 12px;
}
.bar {
color: #ddd;
margin: 0 10px;
}
footer {
margin-top: 30px;
text-align: center;
font-size: 10px;
color: #999;
}
footer a {
color: #999;
margin: 0 5px;
text-decoration: none;
}
select {
color: #999;
border: none;
padding: 5px;
margin-top: 10px;
}
#footer_bold {
color: #666;
font-weight: bold;
}
</style>
</head>
<body>
<header>kakao</header>
<div id="wrap">
<div id="main">
<form action="#">
<input type="text" placeholder="카카오메일 아이디, 이메일, 전화번호" />
<input type="password" placeholder="비밀번호" />
<div class="keep_status">
<input type="checkbox" class="custom-checkbox" /><span>로그인 정보 저장</span>
<button></button>
</div>
<input type="submit" value="로그인" />
<p class="line">또는</p>
<input type="button" value="QR코드 로그인" />
<div class="bottom">
<a href="#">회원가입</a>
<ul class="list_user">
<li>
<a href="#">계정 찾기</a>
</li>
<li>
<a href="#">비밀번호 찾기</a>
</li>
</ul>
</div>
</form>
</div>
</div>
<footer>
<select>
<option>한국어</option>
<option>English</option>
<option>日本語</option>
</select>
<span class="bar">|</span>
<a href="#">이용약관</a>
<span class="bar">|</span>
<a href="#" id="footer_bold">개인정보 처리방침</a>
<span class="bar">|</span>
<a href="#">고객센터</a>
<div>© Kakao Corp.</div>
</footer>
</body>
</html>