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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:59:22+00:00 2026-06-01T05:59:22+00:00

Ladies and Gentlemen, For quite a long time now, I’ve been using the following

  • 0

Ladies and Gentlemen,

For quite a long time now, I’ve been using the following CSS technique to break float by clearing:

{
    display: block;
    content: ".";
    clear: both;
    font-size: 0;
    line-height: 0;
    height: 0;
    overflow: hidden;
}

I would then assign this set of rules to the :before or :after pseudo-elements (or, nowadays, seems to be ::before and ::after, though they’re supposed to fall back to the primer). This, logically, is exactly the same thing as creating a block element either before or after the element, with clear:both, overflow:hidden and no special semantic meaning to the browser.

This allowed me to break the float without putting misleading/ambiguous and lengthy HTML elements (like <div class="clear"></div>) in the code, but still having my unfloated parent accomodate for all the floated children. However, this doesn’t seem be working in many cases on FireFox anymore. Question: why..?

It also seems that there’s no way to inspect these pseudo-elements in the sidebar to see what actually goes on.

Thanks and Regards

  • 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-01T05:59:23+00:00Added an answer on June 1, 2026 at 5:59 am

    Use this:

    .clearfix:before,.clearfix:after{content:"";display:table;}
    .clearfix:after{clear:both;}
    .clearfix{*zoom:1;}
    

    It’s cross-browser and works.

    Example:

    <div class="clearfix">
       <div style="float:left;">1</div>
       <div style="float:left;">2</div>
       <div style="float:left;">3</div>
       <div style="float:left;">4</div>
    </div>
    

    Added style="float:left;" to show they are floating, but don’t use inline CSS.
    No need for extra markup just to clear.

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

Sidebar

Related Questions

Ladies and Gentlemen, Using javascript, how do I access 'id' in a JSON string
Hi Ladies and Gentlemen, We've quite big project with own build framework, based mostly
ladies and gentlemen! Very often on my job I meet the following requirement from
Ladies and gentlemen, I'm stuck. I've been pondering this (and obviously have failed since
Good evening ladies and gentlemen! Searching for a cross-browser solution to embed commercial fonts
Good evening ladies and gentlemen, I have a problem with Java Swing that I
Ladies and gentlemen, I am working hard on a new webapplication which is based
Gentlemen and esteemed ladies. I posted this question in the COM forum at Code
I've made a drop down navigation using Jquery and css. When you click a
Afternoon, ladies and gentlemen! My question is regarding temporary links that would be created

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.