<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>css grid</title>
<style>
body{
background-color: beige;
}
.container
{
display: grid;
grid-template-rows:auto auto;
grid-template-columns: 200px 200px 200px;
grid-gap: 10px;
}
.container div
{
padding: 10px;
text-align: center;
}
.item
{
background: #e0f2f1;
display: flex;
align-items: center;
justify-content: center;
}
</style>
</head>
<body>
<section class="container">
<div class="item">
<img src="images/nature1.jpg" width="150" height="200">
</div>
<div class="item">
<img src="images/nature2.jpg" width="150" height="200">
</div>
<div class="item">
<img src="images/nature3.jpg" width="150" height="200">
</div>
<div class="item">
<img src="images/nature4.jpg" width="150" height="200">
</div>
<div class="item">
<img src="images/nature5.jpg" width="150" height="200">
</div>
<div class="item">
<img src="images/nature6.jpg" width="150" height="200">
</div>
</section>
</body>
</html>






No comments:
Post a Comment
Practice and let me know for nw code snippets