Responsive Web Page with HTML and CSS

 Responsive home page with HTML and CSS with full code


Preview:

1) Pc View:


2) Mobile View:



HTML Code:

index.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>Responsive Website using HTML and CSS</title>
</head>

<body>
    <div class="header-area">
        <div class="menu">
            <div class="logo">
                <img id="logo-image" src="13511.png" alt="">
            </div>
            <ul class="nav-area">
                <li><a href="#">Home</a></li>
                <li><a href="#">About</a></li>
                <li><a href="#">Services</a></li>
                <li><a href="#">Portfolio</a></li>
                <li><a href="#">Contact</a></li>
            </ul>
        </div>
        <div class="banner-text">
            <h1>We are <span>Creative</span></h1>
            <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Ducimus 
magnam dolore explicabo modi rem nullaoptio cum aliquam esse illo laborum 
qui a distinctio, sunt nesciunt enim.</p>
            <a href="#">Contact Us</a>
        </div>
    </div>
</body>

</html>

CSS Code:

* {
    margin0;
    padding0;
}

body {
    font-family: poppins, sans-serif;
    background: linear-gradient(rgba(0000.2), rgba(0000.2)), 
url(image01.jpg) no-repeat;
    /* -webkit-background-size: cover; */
    height100vh;
    background-size: cover;
    /* background-position: center center; */
}

.menu {
    width1170px;
    margin: auto;
}

.header-area {
    position: relative;
}

.nav-area {
    float: right;
    list-style: none;
    margin-top40px;
}

.nav-area li {
    display: inline-block;
}

.nav-area li a {
    color: #fff;
    text-decoration: none;
    padding5px 20px;
    font-size16px;
    text-transform: uppercase;
}

.nav-area li a:hover {
    background: #fff;
    color: #000;
}

.logo {
    float: left;
}

.logo img {
    padding10px 0;
    width10vh;
    height10vh;
}

.banner-text {
    position: absolute;
    width600px;
    height300px;
    margin18% 30%;
    text-align: center;
}

.banner-text h1{
    color: #fff;
    text-transform: uppercase;
    font-size60px;
}

.banner-text h1 span{
    color: #00ffff;
}

.banner-text p{
    color: #fff;
    font-size15px;
    line-height1.5;
}

.banner-text a{
    border1px solid #fff;
    color: #fff;
    display: inline-block;
    margin-top20px;
    font-size14px;
    text-decoration: none;
    text-transform: uppercase;
    padding10px 25px;
}

.banner-text a:hover{
    background-color: #fff;
    color:#000
}

/*Responsive*/
@media(max-width800px){
    .menu{
        width100%;
    }
    .logo{
        float: none;
        width50%;
        text-align: center;
        margin: auto;
    }
    .nav-area{
        float: none;
        margin-top0;
        text-align: center;
    }
    .nav-area li a{
        padding5px;
        font-size11px;
    }
    .banner-text{
        width100%;
        height: auto;
        margin20% 0;
    }
    .banner-text h1{
        font-size30px;
    }
    .banner-text p{
        font-size20px;
        width90%;
        margin: auto;
        line-height1.5;
    }
}


Download all files from here:

https://drive.google.com/file/d/1KJxZj2XmTxdQwsySvVcRCIc3fj-cQnyF/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