방카@Dev
[CSS]부트스트랩을 이용한 반응형 웹페이지 만들기 본문
https://codingnoona.thinkific.com/courses/f3851d
<코딩알려주는누나 html 강의 참고>
1. index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<link rel="stylesheet" href="./style.css"/>
</head>
<body>
<nav class="navbar navbar-expand-lg bg-body-tertiary">
<div class="container-fluid">
<a class="navbar-brand" href="#">LOUIS VUITTON</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">NEW</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">WOMEN</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">MEN</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">ART OF LIVING</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">MAGAGINE</a>
</li>
</ul>
<form class="d-flex" role="search">
<input class="form-control me-2" type="search" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success" type="submit">Search</button>
</form>
</div>
</div>
</nav>
<div id="carouselExampleControls" class="carousel slide" data-bs-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">
<img src="https://www.louisvuitton.com/images/%EB%A3%A8%EC%9D%B4-%EB%B9%84%ED%86%B5--20201208_KR_PUSH1_DI1.jpg?wid=1240" class="d-block w-100" alt="...">
</div>
<div class="carousel-item">
<img src="https://www.louisvuitton.com/images/%EB%A3%A8%EC%9D%B4-%EB%B9%84%ED%86%B5--20201208__14_KR_PUSH1_DI1.jpg?wid=1240" class="d-block w-100" alt="...">
</div>
</div>
<button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleControls" data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Previous</span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#carouselExampleControls" data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Next</span>
</button>
</div>
<div class="text-center mt-5 mb-5">
<h2>JOURNEY HOME FOR THE HOLIDAYS</h2>
<p>Starring Alicia Vikander</p>
<button type="button" class="btn btn-dark">Discover the Campagine</button>
</div>
<div class="container">
<div class="row">
<div class="col-md-4 col-sm-12">
<div class="card">
<img src="https://www.louisvuitton.com/images/louis-vuitton--U_Holidays_2020_Push5_V2_DI1.jpg?wid=656"
class="card-img-top" alt="...">
<div class="card-body">
<p class="card-text text-center">LATEST SELECTION</p>
</div>
</div>
</div>
<div class="col-md-4 col-sm-12">
<div class="card">
<img src="https://www.louisvuitton.com/images/louis-vuitton--U_Holidays_2020_Push6_V2_DI1.jpg?wid=656"
class="card-img-top" alt="...">
<div class="card-body">
<p class="card-text text-center">GIFTS FOR HIM</p>
</div>
</div>
</div>
<div class="col-md-4 col-sm-12">
<div class="card">
<img src="https://www.louisvuitton.com/images/louis-vuitton--U_Holidays_2020_Push7_V2_DI1.jpg?wid=656"
class="card-img-top" alt="...">
<div class="card-body">
<p class="card-text text-center">GIFTS FOR HER</p>
</div>
</div>
</div>
</div>
</div>
<footer>
<div class="container">
<div class="pb-5 pt-5 first-line">
LOUIS VUITTON
</div>
<div class="pb-5 pt-5 second-line">
<div class="row">
<div class="col">United States</div>
<div class="col"><a href="#">Email Sign-up</a></div>
<div class="col"><a href="#">Contact Us</a></div>
<div class="col"><a href="#">Apps</a></div>
<div class="col"><a href="#">Follow Us</a></div>
<div class="col"><a href="#">California Transparency</a></div>
<div class="col"><a href="#">Legal Notice</a></div>
<div class="col"><a href="#">Careers</a></div>
<div class="col"><a href="#">Sitemap</a></div>
</div>
</div>
<div class="third-line pt-5 pb-5 text-center">
Ship to : United States
</div>
</div>
</footer>
integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
crossorigin="anonymous"></script>
</body>
</html>
2.style.css
.first-line{
border-bottom: 1px solid #392d23;
color: white;
}
.second-line{
color:white;
}
.second-line a{
color: white;
text-decoration: none;
}
@media screen and (max-width:48rem){
/* 최대 사이즈 48rem까지 유효함 */
.first-line{
text-align:center;
}
}
@media screen and (max-width:48rem){
.second-line{
padding-left:2rem;
padding-right:2rem;
border-bottom: 1px solid #392d23;
}
}
.third-line{
display:none;
color:white;
}
@media screen and (max-width:48rem) {
.third-line {
display:block;
}
}