Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8674675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:45:55+00:00 2026-06-12T19:45:55+00:00

When I applied float:left to a child div, the parent div compress automatically. I

  • 0

enter image description hereenter image description hereWhen I applied float:left to a child div, the parent div compress automatically. I am writing my CSS code below :

 #footer_wrapper
{
    clear:both;
    background:#f0f0f0; 
    padding:15px 10px 10px 14px;
    border-top:1px solid #dcdcdc;
}
.footer
{
    width:950px;
    margin:0 auto;

}

.services
{
    float:left;
    width:250px;
}

HTML code :

<div id="footer_wrapper">

    <div class="footer">

        <div class="services">
        <h2>Our Services</h2>
            <ul>
                <li><a href="#">7sisters Online Magazine </a></li>
                <li><a href="#">7sisters Business Deals  </a></li>
                <li><a href="#">7sisters Yellow Pages </a></li>
                <li><a href="#">7sisters Air Tickets </a></li>
                <li><a href="#"> 7sisters Jobs </a></li>
                <li><a href="#"> 7sisters Career </a></li>
            </ul>
        </div>    

    </div>


</div>

When I removed float:left from class services the background shows full. Please help me. Can’t find the reason.enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T19:45:57+00:00Added an answer on June 12, 2026 at 7:45 pm

    give the property overflow:hidden to the parent or put a <div style="clear:both"></div> after the last child.

    An element with the float leave the flow of the document, with this two methods, the container actuate like the floats elements stay in the flow.

    The clear method is perfectible, i just gave you a way: If tou search “clear the float css” …
    Here for example

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page with 4 <div> 's that have float: left applied to
When i am applied padding:10px to the child div which have the height 100%
I am trying to float a picture left in the snippet below (a table
Hi have a Paragraph block with the following style applied: form.filters p { clear:both;
I have two divs inside a container div. One need to float left the
CSS border radius is not applied on navigation wrapper. Any ideas why? Fiddle Code:
<div id=example class=k-content> <table id=grid style=float: left; position: relative> <thead> <tr> <th width =310pxdata-field=FileName>File
I have a bunch of images each with the float: left property applied to
<div class=main> <div class=cleft> </div> <div class=cright> </div> </div> .cleft{ float: left; padding-left: 1%;
I have applied this code for iframe id. <iframe id='<?php echo 'fraDisabled'.$i.$post->ID; ?>' src='<?php

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.