Website Home Page using HTML and CSS

 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

*{
    margin0;
    padding0;
    font-family: sans-serif;
}
.container{
    width100%;
    height100vh;
    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-left8%;
    padding-right8%;
    box-sizing: border-box;
}

.navbar{
    height12%;
    display: flex;
    align-items: center;
}
.logo{
    width50px;
    cursor: pointer;
}
.menu-icon{
    width30px;
    cursor: pointer;
    margin-left40px;
}
nav{
    flex1;
    text-align: right;
}
nav ul li{
    list-style: none;
    display: inline-block;
    margin-left60px;
}
nav ul li a{
    text-decoration: none;
    color: #fff;
    font-size15px;
    font-weight: bold;
    padding5px 15px;
    transition0.5s;
}
.row{
    display: flex;
    height88%;
    align-items: center;
}
.col{
    flex-basis50%;
}
h1{
    color: #fff;
    font-size100px;
}
p{
    color: #fff;
    font-size12px;
    line-height15px;
}
button{
    width180px;
    color: #fff;
    font-size12px;
    font-weight: bold;
    padding12px 0;
    background: transparent;
    border1;
    border-color: #fff;
    border-radius20px;
    outline: none;
    margin-top30px;
    cursor: pointer;
    transition0.5s;
}
.card{
    width200px;
    height230px;
    display: inline-block;
    border-radius10px;
    padding15px 25px;
    box-sizing: border-box;
    cursor: pointer;
    margin10px 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-shadow0 0 5px #999;
}
.card p{
    text-shadow0 0 15px #000;
    font-size8px;
}
nav ul li a#home,
nav ul li a:hover{
    background-color: #fff;
    color: #000;
    font-weight: bold;
    border-radius15px;
}
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



CodeStudio

Hi, I am Mayur Dehade. I am a Computer Engineering student, Web Developer, Programmer, and also blogger. On this CodeStudio blog, I have uploaded new and interesting coding-related posts and material like notes and provide a full code file.

Post a Comment (0)
Previous Post Next Post