I have designed a page layout with HTML and CSS but when I put padding for “Left for logo” div then the height of this div increases and I lose the arrangement of page.
In addition, because I’m a beginner for CSS layout, please let me know that my page is correct.
HTML
<!doctype html>
<html lang="fa">
<head>
<meta charset="utf-8">
<title>homepage</title>
<link href="css/home-stylesheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
<header class="header-container">
<div class="header-area"></div>
<div class="logo-ads">
<div class="left">
Left for logo <!-- Set Div As your requirement -->
</div>
<div class="right">
Right for ads<!-- Set Div As your requirement -->
</div>
</div>
</header><!-- end of header -->
<div class="navigation">
navigation
</div><!-- end of nav -->
<div class="main">
main content
</div><!-- end of main -->
<div class="footer-container">
<div class="footer-end">
footer
</div>
</div><!-- end of footer -->
</body>
</html>
CSS
@charset "utf-8";
/* CSS Document */
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
/* header elements */
.header-container {
width: 100%;
}
.header-area {
height: 35px;
width: 100%;
background-color: #bb0700;
padding-right: 0px;
}
.logo-ads {
height: 110px;
width: 1000px;
background-color: #CFD1A9;
padding-right: 0px;
margin-top: 0px;
margin-right: auto;
margin-left: auto;
margin-bottom: 0px;
z-index: 0;
}
.left {
float: left;
height: 110px;
width: 30%;
background-color: #F9F9E4;
padding-right: 0px;
margin-top: 0px;
margin-right: auto;
margin-left: auto;
margin-bottom: 0px;
box-sizing: border-box;
}
.right {
float: right;
width: 70%;
height: 110px;
}
.navigation {
height: 35px;
width: 1000px;
background-color: #2A2929;
padding-right: 0px;
margin-top: 0px;
margin-right: auto;
margin-left: auto;
margin-bottom: 0px;
color: #fff;
z-index: 1;
}
.main {
height: 1000px;
width: 1000px;
background-color: #F7E3E3;
padding-right: 0px;
margin-top: 0px;
margin-right: auto;
margin-left: auto;
margin-bottom: 0px;
z-index: 2;
}
.footer-container {
height:35px;
width: 1000px;
background-color: #F2F1F1;
padding-right: 0px;
margin-top: 0px;
margin-right: auto;
margin-left: auto;
margin-bottom: 0px;
z-index: 3;
}
.footer-end {
height: 35px;
width: 1000px;
background-color: #bb0700;
padding-right: 0px;
margin-top: 0px;
margin-right: auto;
margin-left: auto;
margin-bottom: 0px;
z-index: 4;
}