Web design so that content doesn't fall out of divs - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Div

Description

Web design so that content doesn't fall out of divs

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <title>Lor</title> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
body {<!--from  ww  w. ja va  2s .  c  o  m-->
   height:301px;
   background-color:Chartreuse;
}

#container {
   width:76vw;
   min-height:76vh;
   margin:6% auto 0 auto;
   background-color:yellow;
   padding:6px;
}

#bar {
   width:100%;
   min-height:16%;
   background-color:blue;
   margin-bottom:3px;
   color:pink;
}

#barButton {
   float:left;
   width:29%;
   min-height:91%;
   background-color:OrangeRed;
   display:inline-block;
}

#innerBar {
   float:right;
   width:69%;
   min-height:91%;
   background-color:grey;
   display:inline-block;
}

#txt {
   margin-top:5%;
   background-color:BlueViolet;
   color:Chartreuse;
}

#txt h1 {
   margin:0px;
}

#moreTxt {
   width:81%;
   min-height:21%;
   border:3px solid yellow;
   padding:11px;
   background-color:blue;
}

.clear {
   clear:both;
   float:none;
}
</style> 
 </head> 
 <body> 
  <div id="container"> 
   <div id="bar"> 
    <button id="barButton">Lorem </button> 
    <div id="innerBar">
      Lorem ipsum dolor sit amet, consectetur 
    </div> 
   </div> 
   <div class="clear"> 
   </div> 
   <div id="txt"> 
    <h1>Lorem ip</h1> 
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed fermentum. Aliquam erat volutpat. Vestibulum tortor neque, </p> 
   </div> 
   <div id="moreTxt">
     Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed fermentum. Aliquam erat volutpat. Vestibulum tortor neque, ornare vitae 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials