I'm trying to structure my HTML code in a specific way using CSS. Here's my basic HTML code:
<header></header>
<main>
<nav></nav>
<section></section>
</main>
<footer></footer>
I want the header to be at the top, the footer at the bottom, and the nav and section to be positioned between them. The nav should be on the left and the section on the right, similar to the layout of a website like .
If the main content is smaller than the screen size, I also need the footer to be fixed at the bottom of the screen.
Here is a snippet of the CSS I have so far:
header, nav, section, footer {
padding: 1px 0;
}
header {
background-color: lightcoral;
text-align: center;
background: #FF9900 url("/Content/Images/Etoile.png") 5px center no-repeat;
background-size: 100px;
}
main {
margin: auto;
}
nav {
float: left;
width: 15%;
background-color: lightsalmon;
}
section {
float : right;
width : 85%;
background-color: lightblue;
}
footer {
background-color: lightgreen;
text-align: center;
clear: both;
}
Can anyone provide assistance with achieving this layout?