[태블릿 사이즈 결과 화면]
[모바일 사이즈 결과 화면]
[CSS]
div {
/* width가 padding, border포함하게 하기 */
box-sizing: border-box;
}
body {
margin: 0px;
}
.main-background {
width: 100vw;
height: 100vh;
background-image: url(../versailles.jpg);
background-size: cover;
background-repeat: no-repeat;
padding: 1px;
}
.main-title {
color: white;
font-size: 40px;
font-family: 'Times New Roman';
margin-top: 40px;
margin-right: 20px;
text-align: right;
padding: 1px;
}
.product-title {
font-family: 'Times New Roman';
margin-top: 40px;
color: brown;
text-align: center;
font-size: 30px;
background-color: darkolivegreen;
}
.flex-container {
width: 80%;
display: block;
margin: 20px auto;
background-color: white;
border-radius: 5px;
display: flex;
/* justify-content: center; */
flex-wrap: wrap;
position: relative;
}
.flex-item {
padding-left: 20px;
}
@media screen and (max-width: 1200px) {
.main-title {
font-size: 40px;
}
.flex-item {
width: 50%;
}
.flex-container {
max-width: 800px;
}
}
@media screen and (max-width: 576px) {
.main-title {
font-size: 25px;
}
.flex-item {
width: 100%;
font-size: 15px;
}
}
.main-button {
padding: 10px;
font-size: 15px;
background-color: white;
border: brown;
border-radius: 10px;
/* 버튼 오른쪽 정렬, 흰박스(80%니까 한 쪽당 10%) 따라다니게*/
position: absolute;
right: 10%;
}
[HTML]
<!DOCTYPE html>
<html>
<head>
<meta chatset="UFT-8">
<title>Document</title>
<link href="css/layout.css" rel="stylesheet">
<meta name="viewpoint" content="width=device-width, initial-scale-1.0">
</head>
<body>
<!-- 큰 배경 -->
<div class="main-background">
<h4 class="main-title">Buy Our Items! Now On Sale</h4>
<h3 class="product-title">Christmas Edition!</h3>
<!-- flex-box -->
<div class="flex-container">
<div class="flex-item">
<h4>Fast Shipping</h4>
<p>Super Really Very Fast Shipping</p>
</div>
<div class="flex-item">
<h4>Good Service</h4>
<p>Super Really Very Good Service</p>
</div>
<div class="flex-item">
<h4>Free Coupons</h4>
<p>Super Really Very Nice Free Coupons</p>
</div>
<div class="flex-item">
<h4>New Products</h4>
<p>Super Really Very Cool New Products</p>
</div>
</div>
<!-- 버튼 -->
<div style="clear: both;"></div>
<button class="main-button">Go Shopping</button>
</div>
</body>
</html>
': ) Web > 웹 스터디' 카테고리의 다른 글
[HTML/CSS] 경로설정 오류 Refused to apply style from~is not a supported stylesheet MIME type, and strict MIME checking is enabled. (0) | 2023.12.13 |
---|---|
Bootstarp Grid 레이아웃 (row와 col) (0) | 2023.12.12 |
[HTML, CSS] 반응형 레이아웃 만들기 (media query 문법) (2) | 2023.11.19 |
[HTML, CSS 실습] flex-grow 속성 이용해 상단바 만들기 (0) | 2023.11.19 |
[HTML, CSS] 레이아웃 만들기 - Flexbox (2) | 2023.11.19 |