<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
* {
box-sizing: border-box;
}
body {
font-family: Arial, Helvetica, sans-serif;
}
header {
background-color: #666;
padding: 30px;
text-align: center;
font-size: 35px;
color: white;
}
section {
display: flex;
}
nav {
background-color: #ccc;
padding: 20px;
flex: 1;
}
nav ul {
list-style: none;
padding: 0px;
}
article {
flex: 3;
background-color: #f1f1f1;
padding: 10px;
}
footer {
background-color: #777;
padding: 10px;
text-align: center;
color: white;
}
@media (max-width : 600px) {
section {
flex-direction: column;
}
}
</style>
</head>
<body>
<header>
<h2>Cities</h2>
</header>
<section>
<nav>
<ul>
<li><a href="#">London</a></li>
<li><a href="#">Paris</a></li>
<li><a href="#">Korea</a></li>
</ul>
</nav>
<article>
<h1>London</h1>
<p>London is the capital city of England. It is the most populous city in the United Kingdom, with a metropolitan area of over 13 million inhabitants.</p>
<p>Standing on the River Thames, London has been a major settlement for two millennia, its history going back to its founding by the Romans, who named it Londinium.</p>
</article>
</section>
<footer>
<p>my company</p>
</footer>
</body>
</html>
'개발일지 > HTML' 카테고리의 다른 글
CSS Flex 컨테이너 적용 총정리 (0) | 2022.11.09 |
---|---|
flex활용한 색구분하기 (0) | 2022.11.09 |
수직중앙 수평중앙 중첩하기 (0) | 2022.11.09 |
줄바꿈 배치 flex-warp (0) | 2022.11.07 |
정방향 세로배치, 역방향 세로배치 - flex-direction (0) | 2022.11.07 |
댓글