In this video you’re gonna learn how to create a beautiful landing page with HTML and CSS, so stay tuned and let’s have some fun…!
How To Create A Website Using HTML And CSS Step By Step Website Tutorial
HTML Codes
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Create a Landing Page Using HTML And CSS | Navid Dev</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;700;800&display=swap"
rel="stylesheet"
/>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div class="landing-page">
<div class="container">
<nav class="header-area">
<div class="logo">Your <b>Website</b></div>
<ul class="links">
<li>Home</li>
<li>About Us</li>
<li>Work</li>
<li>Info</li>
<li>Get Started</li>
</ul>
</nav>
<div class="hero">
<div class="info">
<h1>Are You Looking For Inspiration?</h1>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Harum
natus repellat molestiae eum ut autem ipsam voluptate doloribus
corporis eaque velit, tempora hic nemo eveniet. Error ut voluptate
harum deleniti!
</p>
<button>Button Name</button>
</div>
<div class="image">
<img src="./img/undraw_location_search_re_ttoj.svg" alt="" />
</div>
</div>
</div>
</div>
</body>
</html>
CSS Codes
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
body {
font-family: 'Open Sans', sans-serif;
color: #2f2e41;
background-color: #fff;
}
img {
max-width: 100%;
}
ul {
list-style: none;
}
.container {
width: 1280px;
padding-right: 1rem;
padding-left: 1rem;
margin: auto;
}
.header-area {
display: flex;
justify-content: space-between;
padding-top: 25px;
position: relative;
}
.header-area .logo {
text-transform: uppercase;
font-style: italic;
margin-top: 10px;
font-size: 1.3rem;
width: 20%;
}
.header-area .links {
width: 80%;
text-align: right;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-end;
}
.header-area .links li {
margin-left: 30px;
cursor: pointer;
}
.header-area .links li:last-child {
border: 0;
border-radius: 20px;
padding: 10px 18px;
color: #fff;
background-color: #6c63ff;
}
.hero {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 150px;
}
.hero .info {
padding-right: 10%;
}
.hero .info h1 {
font-weight: 800;
font-size: 2.8rem;
margin-bottom: 1.5rem;
line-height: 1.4;
}
.hero .info p {
line-height: 1.6;
font-size: 0.95rem;
color: #5d5d5d;
}
.hero .info button {
border: 0;
border-radius: 2rem;
padding: 1rem 2rem;
margin-top: 2rem;
cursor: pointer;
color: #fff;
background-color: #6c63ff;
font-size: 1rem;
}