728x90
반응형
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>grid-template-columns</title>
<style>
.area{
display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr; grid-gap: 10px; padding: 10px;
}
.item{
padding: 10px;
font-size: 20px; font-weight: bold;
text-align: center;
color: #888;text-decoration: none;
transition: all 0.3s, color 0.3s;
background-color: blue;
}
.item2{
padding: 10px;
font-size: 20px; font-weight: bold;
text-align: center;
color: #888;text-decoration: none;
transition: all 0.3s, color 0.3s;
background-color: red;
}
</style>
</head>
<body>
<div class = "area">
<div class = "item">1</div>
<div class = "item">2</div>
<div class = "item">3</div>
<div class = "item">4</div>
<div class = "item">5</div>
</div>
<div class = "area">
<a href = "#" class = "item2">6</a>
<a href = "#" class = "item2">7</a>
<a href = "#" class = "item2">8</a>
<a href = "#" class = "item2">9</a>
<a href = "#" class = "item2">10</a>
</div>
</body>
</html>
728x90
반응형
'교육 > HTML+CSS' 카테고리의 다른 글
[HTML/CSS] 버튼에 HOVER 속성을 이용하여 에니메이션을 넣어보자 (5) | 2022.10.31 |
---|---|
[CSS] CSS로 동그라미를 그려보자. (4) | 2022.10.14 |
[CSS] 높이 100% (2) | 2022.10.12 |
[HTML] smooth-scroll (0) | 2022.10.12 |
[HTML] 테이블 기초 (2) | 2022.10.11 |