Today, you will learn how to create Responsive Website Layout using only HTML and CSS.I have shared another snippet based on how to create a Responsive Card with HTML and CSS. In this tutorial, I have created a Responsive Website Layout with HTML and CSS, If you like this article, please also subscribe my channel – Code Info
Responsive website layout is about using HTML and CSS to routinely resize, hide, reduce, or expand, a website, to make it appearance proper on all gadgets (computers, tablets, and phones).
Below is the video tutorials. watch and practice.
Whilst considering the format styling for a website it’s crucial to consider the meant purpose and target audience of the layout, the sources available for the internet site (text, snap shots, video, and hyperlinks), your very own layout preferences, and any current branding inclusive of a logo or print advertising and marketing material. Every of these will outline in component the layout selections that are made.
You may like this:
- Sign Up and Login form with HTML and CSS
- Create Login form page with HTML and CSS
- Animated Search Bar with HTML and CSS
The factors that make up the layout are supporting each other in order that the consumer sees the textual content content material with same significance. Further, the factors are effortlessly scannable in a layout that effectively provides them all. The layout gives the impact of balance, and it feels really alluring, from the aesthetic factor of view.
If you like this Responsive Website Layout, then feel free to use it in your project. Copy the code by clicking on Copy button provided below.
Source Code:
First, you have to create two files. One of them is HTML, and the other one is CSS. After creating the files, paste the code provided below.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Resposive Layout | By Code info</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div class="header">
<h1>Header</h1>
</div>
<div class="body-section">
<div class="sidebar">
<h1>Sidebar 1</h1>
</div>
<div class="main-body">
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Expedita modi
repellat laboriosam nam id voluptatibus ab quae, quaerat accusamus
voluptatem, cumque hic, repudiandae laudantium amet exercitationem
numquam. Quaerat obcaecati deleniti quae ut repellendus praesentium
modi illum corporis incidunt, nobis molestias inventore fugit
voluptatibus tempora rem necessitatibus ipsam. Odio aperiam deserunt
quia, enim voluptatem doloremque nobis exercitationem eum, quis,
voluptate ullam minus quidem eos consectetur itaque! Soluta non
similique quod quae odit? Possimus mollitia nemo itaque perferendis
perspiciatis voluptates nostrum consequuntur saepe, aliquid,
repellendus eligendi cumque explicabo adipisci aperiam velit earum
repellat autem sequi? Asperiores soluta, tempore dolor suscipit enim
possimus!
</p>
</div>
<div class="sidebar s2">
<h1>Sidebar 2</h1>
</div>
</div>
<footer>
<div class="footer">
<h1>Footer</h1>
</div>
</footer>
</body>
</html>
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}
h1 {
margin: 0;
padding: 0;
}
.header {
width: 100%;
height: 100px;
border-radius: 20px;
background-color: red;
text-align: center;
color: white;
}
.body-section {
display: flex;
margin: 10px 10px;
}
.sidebar {
width: 15%;
height: 530px;
border-radius: 20px;
background-color: green;
text-align: center;
color: white;
}
.s2 {
background-color: hotpink;
}
.main-body {
width: 68%;
height: 530px;
border-radius: 20px;
background-color: yellow;
text-align: center;
margin: 0 10px 0 10px;
}
.footer {
width: 100%;
height: 80px;
border-radius: 20px;
background-color: blue;
text-align: center;
color: white;
}
@media (max-width: 770px) {
.body-section {
display: block;
}
.main-body {
width: 100%;
height: 340px;
margin: 10px 0 10px 0;
}
.sidebar {
width: 100%;
height: 70px;
text-align: center;
}
}
I hope you liked this snippet. If so, please share the blog and follow us in our social media profiles and stay connected with this blog. Thank you for visiting.