-
-
Notifications
You must be signed in to change notification settings - Fork 79k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Micro clearfix hack breaks "white-space: pre-wrap" #20284
Comments
So, seems like simply adding |
That's a really nice fix you came up with. :) I think it should be included in the Bootstrap CSS where clearfix is defined. Also, please note that I originally reported the problem for Bootstrap 3.3.6 (you can see the version in the link to bootstrap.css in my example). So I never tested it and don't know how the things are in Bootstrap v4. |
CC: @mdo
Yeah, it's just that we're nearing a point where v3 bugs are becoming v3 "features" for compatibility reasons, so we need to evaluate whether it's worth trying to change v3 here. |
Confirmed this is a problem in v4, fwiw. https://jsbin.com/nabowul/ |
This will be fixed by #21224 for v4. |
For the record (since the problem is not referenced in this issue), the extra space was due to the value of the
|
Bootstrap uses http://nicolasgallagher.com/micro-clearfix-hack/ for a lot of its elements. This particular method of cleafixing introduces bugs when an element being clearfixed is set to
white-space: pre-wrap
.For example, I need Bootstrap panel body to have a preformatted content, so I set a style:
.panel-body { white-space: pre-wrap }
. This makes Firefox 47.0.1 and Chrome 51.0.2704.106 (IE11 and Edge somehow are not affected) display extra spaces created by micro clearfix hack (those spaces are not supposed to exist or be visible on the page at all) at the top and bottom of panel body. As a result the panel body looks like it has an extra new line before and after "Panel body" text.First screenshot is without


.panel-body { white-space: pre-wrap }
style, second screenshot with.panel-body { white-space: pre-wrap }
style.The text was updated successfully, but these errors were encountered: