Simple code for HTML 5 Layout

HTML Layout Elements

HTML has several semantic elements that define the different parts of a web page:

HTML5 Semantic Elements
  • <header> - Defines a header for a document or a section
  • <nav> - Defines a set of navigation links
  • <section> - Defines a section in a document
  • <article> - Defines an independent, self-contained content
  • <aside> - Defines content aside from the content (like a sidebar)
  • <footer> - Defines a footer for a document or a section

 

 Simple Code for HTML 5 Layout Elements: 

 
 
<!DOCTYPE html>
<html>
<head>
<title>HTML 5 Layout</title>
</head>
<style>
header{
    background-color: brown;
    margin:10px;
    padding: 40px;
}
nav{
    background-color: aqua;
    margin:10px;
    padding: 20px;
}
section{
    background-color: blueviolet;
    margin:10px;
    padding: 40px;
}
article{
    background-color: aquamarine;
    margin:10px;
    padding: 40px;
}
aside{
    background-color: mediumseagreen;
    margin:10px;
    padding: 40px;
    height: 125px;
   
}
footer{
    background-color: brown;
    margin:10px;
    padding: 40px;
}
.div1               {
    float: left;
    width: 70%;
}
.div2               {
    float: left;
    width: 30%;
   
}
.div3               {
    clear: both;
}
</style>
<body>
<header>Header</header>
<nav>Nav Menu</nav>
<div class="div1"><section>Section Part</section>
    <article>Article Part</article>
</div>
<div class="div2">
    <aside>Aside Part</aside>
</div>
<div class="div3">
    <footer>Footer Part</footer>
</div>

</body>

</html>





Output: 

html 5 layout elements


 

 

Click here to Download above  Code Files

Comments