html - divs inside div not working properly -


this question has answer here:

<div id="footer">     <div>     <h2>revovation</h2>     <p>our mission provide best handyman service @ reasonable price without sacrificing quality. satisfy our work knowing take necessary steps meet needs , job done right     </p>     </div>     <div>         <h2>information</h2>             <div>                 <ul>                     <li>blog</li>                     <li>services</li>                     <li>extras</li>                     <li>contact</li>                 </ul>             </div>             <div>                 <ul>                     <li>projects</li>                     <li>information</li>                     <li>about us</li>                     <li>shop</li>                 </ul>             </div>     </div>     <div>         <h2>renovation office</h2>         <ul>             <li><img src="images/marker.png" alt="">address</li>             <li>phone</li>             <li>email</li>             <li>fax</li>             <li>timings</li>         </ul>     </div>  </div> 

edit: adding css

#footer {      background  :  #282828;      border: 2px solid blue;     font-family  :  verdana;     position: relative;      color : #8e9a8c; }   #footer div {     background  :  #282828; !important;     width  :  28%;     border: 1px solid red;     float : left;     padding: 60px 0px 30px 40px; } 

blue border footer div , red border divs inside it. floating inside divs left. why wont outer div cover 3 inner child divs? have no clue whats going wrong in here!

output screenshot

this looks prime case of floating children of element collapsing parent's height: https://css-tricks.com/snippets/css/clear-fix/

.clearfix:after {     visibility: hidden;     display: block;     font-size: 0;     content: " ";     clear: both;     height: 0;     } * html .clearfix             { zoom: 1; } /* ie6 */ *:first-child+html .clearfix { zoom: 1; } /* ie7 */ 

simply add class clearfix element who's height has collapsed, in case:

<div id="footer" class="clearfix"> 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -