Home Page Using HTML and CSS
Home Page :-
A home page is a webpage that serves as the starting point of website. It is the default webpage that loads when you visit a web address that only contains a domain name.
Source Code :-
HTML :-
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HomePage</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.14.0/css/all.css" integrity="sha384-HzLeBuhoNPvSl5KYnjx0BT+WB0QEEqLprO+NBkkk5gbc67FTaL7XIGa2w1L0Xbgc" crossorigin="anonymous">
</head>
<body>
<nav class="menu_area">
<ul>
<li>Logo</li>
<li>Home</li>
<li>About</li>
<li>Contact</li>
</ul>
<form action="/action_page.php">
<input type="search" placeholder="Search here....">
<button><i class="fas fa-search"></i></button>
</form>
</nav>
<div class="banner_text">
<h2>Programming School</h2>
<p>" Any foo can write code that a computer can understand "</p>
</div>
</body>
</html>
CSS :-
body{
background-image: linear-gradient(rgba(0,0,0.3), rgba(0,0,0,0.3)), url(background.jpg);
background-size: cover;
background-position: center;
height: 100vh;
overflow: hidden;
font-family: sans-serif;
}
.menu_area{
display: -webkit-flex;
display: -moz-flex;
display: -o-flex;
display: flex;
background: transparent;
color: white;
padding: 1em;
}
.menu_area ul{
list-style: none;
padding: 0;
margin: 0;
display: -webkit-flex;
display: -moz-flex;
display: -o-flex;
display: flex;
flex: 3;
}
.menu_area li{
margin-right: 2em;
cursor: pointer;
}
ul li:nth-child(1){
font-family: Forte Regular;
font-size: 30px;
text-transform: uppercase;
}
ul li:nth-child(2),
ul li:nth-child(3),
ul li:nth-child(4){
padding: 10px 20px;
font-family: sans-serif;
}
ul li:nth-child(2):hover,
ul li:nth-child(3):hover,
ul li:nth-child(4):hover{
background-color: white;
color: #707070;
border-radius: 50px;
}
.menu_area form{
display: -webkit-flex;
display: -moz-flex;
display: -o-flex;
display: flex;
justify-content: flex-end;
flex: 1;
}
.menu_area input{
flex: 1;
border: 1px solid #989898;
outline: none;
border-radius: 50px;
padding: 0 25px;
background: transparent;
color: white;
}
::-webkit-input-placeholder{
color: #989898;
}
.menu_area button{
background: transparent;
border-radius: 50px;
color: white;
border: 1px solid #989898;
padding: 0 30px;
margin-left: 0.3rem;
}
.menu_area button:hover{
background-color: #fff;
color: #707070;
}
.banner_text{
color: #ececec;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
}
.banner_text h2{
font-size: 45px;
margin: 0;
text-transform: uppercase;
font-family: Showcard Gothic Regular;
letter-spacing: 5px;
}
.banner_text p{
font-size: 20px;
}
@media screen and (max-width: 575px){
.menu_area {
flex-direction: column;
}
.menu_area ul{
flex-direction: row;
margin-bottom: 1em;
}
.menu_area input{
padding: 13px 20px;
}
.menu_area li{
margin-right: 0.5em;
}
.banner_text h2{
font-size: 40px;
}
.banner_text p{
font-size: 13px;
}
}
Comments
Post a Comment