HTML
Before we start writing code first, we need to create a primary structure of the HTML document, so that the browser can understand and start working. The basic HTML structure looks like the following.
After writing the primary structure of the HTML document, you will also write the tags and content you need. After that, you can see the output in your browser. We know that HTML Sudu Mae is used for exposing content in a basic format. To complete our content we need to use CSS, which is an HTML insert and it creates an engaging user interface.
<!DOCTYPE html>
<html>
<head>
<title>Home Page</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<header>
<div class="container">
<div class="logo">
<img src="logo.png">
</div>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">About</a></li>
</ul>
<div class="title">
<h1>Easy Coding</h1>
</div>
<div class="botton">
<a href="#" class="btn">Register Now</a>
<a href="#" class="btn">Learn More</a>
</div>
</div>
</header>
</body>
</html>
<html>
<head>
<title>Home Page</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<header>
<div class="container">
<div class="logo">
<img src="logo.png">
</div>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">About</a></li>
</ul>
<div class="title">
<h1>Easy Coding</h1>
</div>
<div class="botton">
<a href="#" class="btn">Register Now</a>
<a href="#" class="btn">Learn More</a>
</div>
</div>
</header>
</body>
</html>
CSS
Now, we have time to improve the HTML content, for that, we need to add CSS to the HTML file. CSS can be added to HTML documents in a total of three ways, here we are using outside CSS design using CSS will arrive here after typing and see the output in your browser.
*{
padding: 0;
margin: 0;
font-family: centary Gothic;
}
header{
background-image: url(bg.jpg);
height: 100vh;
background-size: cover;
background-position: center;
}
ul{
list-style: none;
float: right;
margin-top: 40px;
font-size: 20px;
}
ul li{
display: inline-block;
}
a{
text-decoration: none;
color: white;
padding: 5px 20px;
border:2px solid transparent;
transition: 0.9s;
border-radius: 10px;
}
a:hover{
background-color: white;
color: black
}
.logo img{
float: left;
width:250px;
height: auto;
padding-left: 10px;
margin-top: 15px;
}
.container{
max-width: 1200px;
margin: auto;
}
.title{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
h1{
color: white;
font-size: 100px;
}
.botton{
position: absolute;
top: 70%;
left: 50%;
transform: translate(-50%, -50%);
}
.btn{
border:1px solid white;
padding: 10px 30px;
color: white;
text-decoration: none;
transition: 0.5s ease;
border-radius: 10px;
}
.btn:hover{
background-color: white;
color: black;
}
padding: 0;
margin: 0;
font-family: centary Gothic;
}
header{
background-image: url(bg.jpg);
height: 100vh;
background-size: cover;
background-position: center;
}
ul{
list-style: none;
float: right;
margin-top: 40px;
font-size: 20px;
}
ul li{
display: inline-block;
}
a{
text-decoration: none;
color: white;
padding: 5px 20px;
border:2px solid transparent;
transition: 0.9s;
border-radius: 10px;
}
a:hover{
background-color: white;
color: black
}
.logo img{
float: left;
width:250px;
height: auto;
padding-left: 10px;
margin-top: 15px;
}
.container{
max-width: 1200px;
margin: auto;
}
.title{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
h1{
color: white;
font-size: 100px;
}
.botton{
position: absolute;
top: 70%;
left: 50%;
transform: translate(-50%, -50%);
}
.btn{
border:1px solid white;
padding: 10px 30px;
color: white;
text-decoration: none;
transition: 0.5s ease;
border-radius: 10px;
}
.btn:hover{
background-color: white;
color: black;
}
How To Create A Website Homepage Using HTML And CSS
Reviewed by easycoding
on
August 29, 2020
Rating:
No comments: