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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:31:41+00:00 2026-06-15T08:31:41+00:00

This is a strange CSS issue that I’m hoping someone can shed some light

  • 0

This is a strange CSS issue that I’m hoping someone can shed some light on…

I’m using Twitter Bootstrap and I’m seeing some very odd float/clearing behaviour. I have a right floated div and a form-horizontal in the main content. The second form field seems to clear below the floated div for no good reason. Going through all the HTML elements and the CSS declarations it’s a strange property that is causing this to happen. I have reduced it down to a single CSS declaration:

 .control-group::before, .form-horizontal .control-group::after {
   display: table;
   content: "";
   line-height: 0;
 }

Specifically, the content: “”; If you disable this one declaration, it floats up with the first field and all is well.

I have created a JS fiddle to demonstrate: http://jsfiddle.net/whiteatom/UJ89p/1/embedded/result/

With the source code: http://jsfiddle.net/whiteatom/UJ89p/1/

Is this by design? W3 spec? Is this specific to only some browsers (tested in Chrome, Safari and FF on MacOS)? What is the Bootstrap team trying to accomplish with this empty string property? Can I override it without editing the bootstrap CSS files?

Cheers,

  • 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-15T08:31:42+00:00Added an answer on June 15, 2026 at 8:31 am

    Is this by design?

    Yes.

    W3 spec?

    Here it is. An empty string is still considered content; if you want to completely prevent a box from being generated, you need to use content: none instead. Without modifying the Bootstrap files, you should be able to just add the following rule to your own stylesheet (overriding the content: "" declaration):

    /* Single-colon pseudo-elements for consistency with Bootstrap's IE8 compat */
    .form-horizontal .control-group:before, .form-horizontal .control-group:after {
        content: none;
    }
    

    Note that the float is being cleared because the ::after pseudo-element is being used as a clearfix. The clear declaration is residing in a separate rule elsewhere in the Bootstrap stylesheet:

    .form-horizontal .control-group:after {
        clear: both;
    }
    

    By adding the proper content: none declaration it will prevent the pseudo-element from being rendered at all, thereby preventing clearance.

    Is this specific to only some browsers (tested in Chrome, Safari and FF on MacOS)? What is the Bootstrap team trying to accomplish with this empty string property?

    Some very old versions of Chrome, Safari, Firefox and Opera don’t support content: none, and instead incorrectly treat content: "" (with the empty string) as having no content. The versions that do support content: none treat both values correctly, as does IE8 and later.

    I’m guessing by using the empty string, they’re trying to account for these older browsers. If that’s the case, it should have been overridden with content: none so newer versions will use the correct value, like this:

    .form-horizontal .control-group:before, .form-horizontal .control-group:after {
        display: table;
        content: "";
        content: none;
        line-height: 0;
    }
    

    If so — and that’s my best guess — then a bug report may be in order.

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

Sidebar

Related Questions

I have a very strange issue, that I'm hoping someone here can help me
I have this strange issue going on with my CSS on my site, and
I have this strange issue with css hover, on chrome and safari (on opera
I have a very strange issue that only affects webkit browsers for some reason,
I came across this strange bit of CSS tonight... display: inline !ie; Now I've
Could someone explain this (strange) behavior? Why is the length in the first example
I just come across this strange situation . I was using the technique of
I have a strange issue that I am asked to make a Spring MVC
I've been reading up on how I can dynamically load a css file using
I jave a strange issue, I'am using the mediaelement js media player to serve

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.