CSS/CSS_TEST
CSS_exam
ldh1123
2023. 3. 21. 21:06
목차
CSS_exam
[전체]
- 앵커 스크롤 이동시 부드럽게 이동되도록 설정
- 미디어 쿼리를 사용하지 않고 반응형 레이아웃을 구성
- footer는 항상 뷰포트 화면 아래에 고정
[a tag]
- 밑줄을 제거한다.
- 폰트 색상은 white
- 배경색은 goldenrod
[ul tag]
- 스타일을 제거한다. (list 마다 앞에 생성되는 점을 제거한다.)
[아이템]
# 아래의 이미지처럼 나타나게 css 처리
- 이미지(제목), 내용, 버튼이 위에서 아래로 레이아웃 구성
- 제목 (Billions upon billions)는 이미지 위에 위치
- 제목의 배경색은 alpha값을 적용하여 뒤쪽 이미지가 보이도록 처리
- 아이템의 border 모서리를 라운드 처리
-------------------------------
[반응형]
[데스크탑 – width: 약 1700px 이상]
- 아이템이 한 줄에 5개가 나타나도록 처리
[데스크탑 – width: 약 1400px 이상]
- 아이템이 한 줄에 4개가 나타나도록 처리
[태블릿(가로) – width: 약 1000px 이상]
- 아이템이 한 줄에 3개가 나타나도록 처리
[태블릿(세로) – width: 약 700px 이상]
- 아이템이 한 줄에 2개가 나타나도록 처리
[모바일(세로) – width: 약 700px 미만]
- 아이템이 한 줄에 1개가 나타나도록 처리
/* grid */
* {
margin: 0;
padding: 0;
scroll-behavior:smooth;
box-sizing: border-box;
}
a {
text-decoration: none;
color: white;
background-color: goldenrod;
border: 1px solid goldenrod;
border-radius: 5px;
padding: 10px;
}
a:hover {
border: 1px solid rgba(218, 165, 32, 0.432);
background-color: rgba(218, 165, 32, 0.432);
}
.hero {
width: 100vw;
height: 100%;
color: white;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(320px,1fr))
}
.hero > h1 {
margin-top: 100px;
margin-left: 20px;
}
.hero > article {
width: 100%;
margin-top: 50px;
margin-bottom: 50px;
margin-right: 20px;
padding: 50px;
}
.hero a {
position: relative;
top: 20px;
}
h1 {
font-size: 40px;
}
li > p {
color: rgb(92, 90, 90);
}
ul {
list-style-type: none;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(320px,1fr));
grid-gap: 10px;
margin: 20px;
width: 100%;
}
li {
border: 1px solid rgba(0, 0, 0, 0.144);
border-radius: 5px;
margin: 10px;
padding: 10px 20px 10px 20px;
width: 100%;
height: 100%;
}
li a {
position: relative;
top: 15px;
}
figure {
position: relative;
}
figure > img {
width: 100%;
}
figcaption {
position: absolute;
color: white;
width: 100%;
height: 30%;
background-color: rgba(0, 0, 0, 0.568);
top: 68%;
padding: 10px;
}
footer {
position: fixed;
bottom: 1px;
width: 100%;
background-color: rgba(0, 0, 0, 0.24);
text-align: center;
}
/* flex */
/* * {
margin: 0;
padding: 0;
scroll-behavior:smooth;
box-sizing: border-box;
}
a {
text-decoration: none;
color: white;
background-color: goldenrod;
border: 1px solid goldenrod;
border-radius: 5px;
padding: 10px;
}
a:hover {
border: 1px solid rgba(218, 165, 32, 0.432);
background-color: rgba(218, 165, 32, 0.432);
}
.hero {
width: 100vw;
height: 100%;
color: white;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.hero > h1 {
width: 300px;
margin-top: 100px;
margin-left: 3vw;
}
.hero > article {
width: 500px;
margin-top: 50px;
margin-bottom: 50px;
margin-right: 3vw;
padding: 3vw;
}
.hero a {
position: relative;
top: 20px;
}
h1 {
font-size: 40px;
}
li > p {
color: rgb(92, 90, 90);
}
ul {
list-style-type: none;
display: flex;
flex-wrap: wrap;
margin: 20px;
width: 100%;
}
li {
border: 1px solid rgba(0, 0, 0, 0.144);
border-radius: 5px;
margin: 10px;
padding: 10px 20px 10px 20px;
width: 320px;
height: 40vh;
}
li a {
position: relative;
top: 15px;
}
figure {
position: relative;
}
figure > img {
width: 100%;
}
figcaption {
position: absolute;
color: white;
width: 100%;
height: 30%;
background-color: rgba(0, 0, 0, 0.568);
top: 68%;
padding: 10px;
}
footer {
position: fixed;
bottom: 1px;
width: 100%;
background-color: rgba(0, 0, 0, 0.24);
text-align: center;
} */
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="./exam.css">
<style>
@import url('https://fonts.googleapis.com/css?family=Playfair+Display|Source+Sans+Pro:200,400');
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: 'Playfair Display', serif;
}
p,
a {
font-family: 'Source Sans Pro', sans-serif;
}
</style>
</head>
<body>
<div class="wrapper">
<section class="hero" style="background: url('./img/img_1.jpg') center; background-size: cover;">
<h1>You thirsty?</h1>
<article>
<p>Explore local breweries with just one click and stirred by starlight across the centuries light years
great turbulent clouds circumnavigated paroxysm of global death.</p>
<a href="#breweries">Browse Breweries</a>
</article>
</section>
<section class="breweries" id="breweries">
<ul>
<li>
<figure>
<!-- Photo by Quentin Dr on Unsplash -->
<img src="img/item_1.jpg" alt="item_1.jpg">
<figcaption>
<h3>Billions upon billions</h3>
</figcaption>
</figure>
<p>
Made in the interiors of collapsing stars star stuff harvesting star light venture billions upon
billions Drake Equation brain is the seed of intelligence?
</p>
<a href="#">Visit Website</a>
</li>
<li>
<figure>
<img src="img/item_2.jpg" alt="item_2.jpg">
<figcaption>
<h3>Drake Equation</h3>
</figcaption>
</figure>
<p>
Another world citizens of distant epochs from which we spring descended from astronomers Orion's
sword shores of the cosmic ocean.
</p>
<a href="#">Visit Website</a>
</li>
<li>
<figure>
<img src="img/item_3.jpg" alt="item_3.jpg">
<figcaption>
<h3>Vast cosmic arena</h3>
</figcaption>
</figure>
<p>
Galaxies the ash of stellar alchemy prime number science inconspicuous motes of rock and gas
brain is the seed of intelligence.
</p>
<a href="#">Visit Website</a>
</li>
<li>
<figure>
<img src="img/item_4.jpg" alt="item_4.jpg">
<figcaption>
<h3>Wall Painting, VUOTO Project</h3>
</figcaption>
</figure>
<p>
We can finally share our work made for Vuoto project in Altomonte, one of the most beautiful
experiences of our life.
</p>
<a href="#">Visit Website</a>
</li>
<li>
<figure>
<img src="img/item_5.jpg" alt="item_5.jpg">
<figcaption>
<h3>The Peregrine Falcons</h3>
</figcaption>
</figure>
<p>
They are machines, alive and powerful.Their lines are inspired by those of the Urwerk watches:
sharp and fluid. They are not specifically mechanical birds,
</p>
<a href="#">Visit Website</a>
</li>
</ul>
</section>
</div>
<footer>
<p>© 2021. KOREA IT ACADEMY</p>
</footer>
</body>
</html>
Github