stretch a div from navigation bar to footer - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Footer

Description

stretch a div from navigation bar to footer

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
body {<!--   w w  w  . j ava2s .  co  m-->
   background:Chartreuse;
}

.title-bar {
   position:fixed;
   width:100%;
   top:0;
   background-color:yellow;
}

#title {
   margin:0 0 0 0;
   text-align:center;
   font-size:41px;
   font-family:"League-Gothic", Courier;
   color:blue;
   font-weight:601;
}

#navbar ul {
   margin:0;
   padding:6px;
   list-style-type:none;
   text-align:left;
   background-color:pink;
}

#navbar ul li {
   display:inline;
   font-family:Arial;
}

#navbar ul li a {
   text-decoration:none;
   padding:.3em 2em;
   color:OrangeRed;
   background-color:grey;
}

#navbar ul li a:hover {
   color:BlueViolet;
   background-color:Chartreuse;
}

#content {
   margin-top:123px;
   background-color:yellow;
   font-family:Arial;
   border-bottom-left-radius:6px;
   border-bottom-right-radius:6px;
   padding:6px;
   padding-left:16px;
   padding-right:16px;
   overflow:auto;
}

#footer {
   position:fixed;
   bottom:0;
   left:0;
   width:100%;
   background:blue;
   line-height:3;
   text-align:center;
   color:pink;
   font-size:16px;
   font-family:sans-serif;
}
</style> 
 </head> 
 <body> 
  <div class="title-bar"> 
   <div id="title">
     Lorem i 
   </div> 
   <div id="navBar"> 
    <ul> 
     <li> <a id="link1" href="#">Lorem </a> </li> 
     <li> <a id="link2" href="#">Lorem </a> </li> 
     <li> <a id="link3" href="#">Lorem </a> </li> 
    </ul> 
   </div> 
  </div> 
  <div id="content"> 
   <h1>Lorem ipsum dolor sit </h1> 
   <p>Lo</p> 
   <p>Lor</p> 
   <p>Lorem </p> 
   <p>Lorem ip</p> 
   <p>Lorem </p> 
   <p>Lorem i</p> 
   <p>Lor</p> 
   <p>Lorem ipsum </p> 
   <p>Lorem ipsum dolor </p> 
   <p>Lorem ipsum dolor sit</p> 
  </div> 
  <div id="footer">
    Lorem ip 
  </div>  
 </body>
</html>

Related Tutorials