Make website home page using by Html and CSS
Preview:
HTML Code:
sahara.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<title>Document</title>
</head>
<body>
<div class="container">
<div class="navbar">
<img src="img/logo.png" class="logo">
<nav>
<ul>
<li><a id="home" href="#">Home</a></li>
<li><a href="#">Contact Us</a></li>
<li><a href="#">About</a></li>
</ul>
</nav>
<img src="img/menu.png" class="menu-icon">
</div>
<div class="row">
<div class="col">
<h1>Sahara</h1>
<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Vel
voluptatibus at aliquid sed enim officiis provident qui odit quisquam, omnis
numquam ipsam ducimus quaerat ea dicta consectetur, quibusdam distinctio quasi!</p>
<button type="button">Explore</button>
</div>
<div class="col">
<div class="card card1">
<h5>Western Desert</h5>
<p>Lorem ipsum dolor, sit amet consectetur adipisicing elit.
Placeat, ipsam.</p>
</div>
<div class="card card2">
<h5>AI Bagawat</h5>
<p>Lorem ipsum dolor, sit amet consectetur adipisicing elit.
Placeat, ipsam.</p>
</div>
<div class="card card3">
<h5>Pyramid of Giza</h5>
<p>Lorem ipsum dolor, sit amet consectetur adipisicing elit.
Placeat, ipsam.</p>
</div>
<div class="card card4">
<h5>Kalahari Desert</h5>
<p>Lorem ipsum dolor, sit amet consectetur adipisicing elit.
Placeat, ipsam.</p>
</div>
</div>
</div>
</div>
</body>
</html>
CSS Code:
style.css
*{
margin: 0;
padding: 0;
font-family: sans-serif;
}
.container{
width: 100%;
height: 100vh;
background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)),
url(img/background.png);
background-size: cover;
background-position: center;
padding-left: 8%;
padding-right: 8%;
box-sizing: border-box;
}
.navbar{
height: 12%;
display: flex;
align-items: center;
}
.logo{
width: 50px;
cursor: pointer;
}
.menu-icon{
width: 30px;
cursor: pointer;
margin-left: 40px;
}
nav{
flex: 1;
text-align: right;
}
nav ul li{
list-style: none;
display: inline-block;
margin-left: 60px;
}
nav ul li a{
text-decoration: none;
color: #fff;
font-size: 15px;
font-weight: bold;
padding: 5px 15px;
transition: 0.5s;
}
.row{
display: flex;
height: 88%;
align-items: center;
}
.col{
flex-basis: 50%;
}
h1{
color: #fff;
font-size: 100px;
}
p{
color: #fff;
font-size: 12px;
line-height: 15px;
}
button{
width: 180px;
color: #fff;
font-size: 12px;
font-weight: bold;
padding: 12px 0;
background: transparent;
border: 1;
border-color: #fff;
border-radius: 20px;
outline: none;
margin-top: 30px;
cursor: pointer;
transition: 0.5s;
}
.card{
width: 200px;
height: 230px;
display: inline-block;
border-radius: 10px;
padding: 15px 25px;
box-sizing: border-box;
cursor: pointer;
margin: 10px 15px;
background-position: center;
background-size: cover;
transition: transform 0.5s;
}
.card1{
background-image: url(img/pic-1.png);
}
.card2{
background-image: url(img/pic-2.png);
}
.card3{
background-image: url(img/pic-3.png);
}
.card4{
background-image: url(img/pic-4.png);
}
.card:hover{
transform: translateY(-10px);
}
h5{
color: #fff;
text-shadow: 0 0 5px #999;
}
.card p{
text-shadow: 0 0 15px #000;
font-size: 8px;
}
nav ul li a#home,
nav ul li a:hover{
background-color: #fff;
color: #000;
font-weight: bold;
border-radius: 15px;
}
button:hover{
background-color: #fff;
color: #000;
font-weight: bold;
}
Download all files from here:
https://drive.google.com/file/d/1ZFwLwrwp8FY7E81z550Pz_jfSPIT3Jr7/view?usp=sharing
-By CodeStudio