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 903265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:50:54+00:00 2026-05-15T15:50:54+00:00

I have always thought that the correct way to handle CSS floats was to

  • 0

I have always thought that the correct way to handle CSS floats was to use either a clear div, :after pseudo class, or overflow: auto on the parent. As I understand it clear is designed to clear floats and expand the parent element back to normal. That is it’s purpose, yes?

Today I found heard of an alternate method of handling the float (and parent collapse): floating the parent as well to make it expand around the floated child.

How does this align with web standards? Is there even an official float/clear standard?

  • 1 1 Answer
  • 1 View
  • 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-05-15T15:50:54+00:00Added an answer on May 15, 2026 at 3:50 pm

    As @edeverett said, there is no particular standard.

    Real beginners use absolute positioning and enter the nightmare mode as there is so many constraints and things to care about.

    Beginners tend to float everything within the content and then search where the background of the parent is, though with no content in the flow the parent can’t have a visible background anymore …
    I had hard times with IE6 and the last column (too large for the whole design) going under the others (due whether to doubled margin float bug or a width 100% + padding/margin on a child)

    Then you learn many different techniques, each with its strength and constraints and problems.

    Then you learn by experience when to use each of them. Even absolute positioning in seldom cases ; even layout tables in desperate cases. They’re bad but a layout with 25 divs waiting to explode as soon as you add 1px somewhere are worse.
    A rule of thumb is the less you remove content from the flow, the less you have problems. And there always many ways to do the same thing in CSS.

    My personal favorite is the versatile display: inline-block;
    Now that Fx 3.x has replaced Fx 2.0 (3.0 is even disappearing), it’s supported by every browser (display: inline; + zoom: 1; + conditional comment for IE<8).
    Two minor annoyances I can think of:

    • Whitespace needs a trick like a </div><!-- comment --><div> between two consecutive div to avoid it
    • vertical-align: top; is often required and is hard to spot when you begin to use it

    On forms with a label + input per line, it does wonders, compared to floats. Same in headers or footers.

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

Sidebar

Related Questions

I have always thought that in order to connect to SQL server using windows
I have always thought that replacing the normal windows desktop icons with an active
I have always thought it was best practice to be explicit in naming my
I am a self thought hobby programmer and therefore don't have the fundamentals always
I have always wondered how delegates can be useful and why shall we use
I'm a huge fan of cakephp's containable element, because I always thought, that it
I always thought that setting InstanceContextMode to PerCall makes concurrency mode irrelevant even if
I have a 2-dimensional jagged array (though it's always rectangular), which I initialize using
Are hashtables always faster than trees? Though Hashtables have O(1) search complexity but suppose
I have always and will continue to always close an HTML input such as

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.