Web development
페이지 박스 만들기_div / CSS
WEB_CREASTORY
2023. 7. 10. 20:38
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
crossorigin="anonymous"></script>
<title> 스파르타코딩클럽 | 부트스트랩 연습하기</title>
<style>
.mytitle {
background-color: green;
color: white;
height: 250px;
}
</style>
</head>
<body>
<div class="mytitle">
<h1>내 생애 최고의 영화들</h1>
<button>영화 기록하기</button>
</div>
</body>
</html>
display: flex;
flex-direction: column; // 내용물 세로 정렬, row 가로정렬
align-items: center;
justify-content: center;
div 안 내용물 정렬에 코드 4세트 사용 >> 버튼 투명하게 / 실선 적용
.mytitle > button {
width: 250px;
height: 50px;
background-color: transparent;
border: 1px solid white;
color: white;
border-radius: 50px;
margin-top: 20px;
}
클릭시 버튼 두꺼워지게 hover 생기게 적용
.mytitle > button:hover {
border: 2px solid white;
}
이미지 코드 3set
background-image: linear-gradient(0deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('');
background-position: center;
background-size: cover;
이미지 어둡게 하기 background-image에 linear-gradient(0deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)) 추가
구글 폰트로 글씨체 정리 >> 완성
* {
font-family: 'Gowun Dodum', sans-serif;
}