Skip to content

IE8 wraps label text when it shouldn't #15275

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

Closed
bbrdaric opened this issue Dec 3, 2014 · 9 comments
Closed

IE8 wraps label text when it shouldn't #15275

bbrdaric opened this issue Dec 3, 2014 · 9 comments

Comments

@bbrdaric
Copy link

bbrdaric commented Dec 3, 2014

Hello,

a fix that solved #13141 is now causing another misbehavior of label in IE8 when using Bootstrap 3.3.1. Reverting to 3.1.1 solves that problem.

It seems that now label width cannot be correctly calculated and breaks when it's floating.

I believe that @ahocquet also noticed this and mentioned in #13141 (comment)

For now, as a workaround for this problem, we detect ie8 using conditional comments and override max-width with something like this

.lt-ie9 label {
    max-width: inherit;
}

Reduced examples

http://sandbox.boris-samardzija.from.hr/bootstrap/bootstrap-3.3.1.html
http://sandbox.boris-samardzija.from.hr/bootstrap/bootstrap-3.1.1.html

Screenshots

Problematic label wrapping in 3.3.1

bootstrap-3 3 1

Seems okay in 3.1.1

bootstrap-3 1 1

@cvrebert cvrebert added the css label Dec 3, 2014
@cvrebert cvrebert added this to the v3.3.3 milestone Jan 8, 2015
@cvrebert
Copy link
Collaborator

JS Bin for posterity: http://jsbin.com/baqilu/2

@cvrebert cvrebert changed the title IE8 - fix for label overflow caused another label misbehavior IE8 wraps label text when it shouldn't Jan 14, 2015
@kkirsche
Copy link
Contributor

Is there a reason we are using display: inline-block instead of simply display: inline? Changing to display: inline; fixes this issue in IE 8 with no noticeable issues in the JSBin on other browsers (that I can see). Let me know if you want this as a pull request

@kkirsche
Copy link
Contributor

Just wanted to follow up regarding this and see if there is a reason we are using display: inline-block instead of simply display: inline?

@cvrebert
Copy link
Collaborator

CC: @mdo

@cvrebert
Copy link
Collaborator

The last change was from block to inline-block, in fe8061b.

@bbrdaric
Copy link
Author

@kkirsche, try that on "Basic example" on http://getbootstrap.com/css/#forms and you will notice that there is difference in margins (bottom margin will be ignored).

Label element is inline by default, but in order to use margins and/or width/height, it must be inline-block or block.

This seems to be caused by unfortunate combination of inline-block and max-width, so I would suggest to find another solution for #13141 (which is also IE8 bug) that wouldn't stop us from using inline-block on labels (which is working okay in modern browsers).

@kkirsche
Copy link
Contributor

I see what you mean @borissamardzija — thanks for sharing that example, I was just looking at the JSBin

@mdo
Copy link
Member

mdo commented Jan 30, 2015

Yup, for all the reasons @borissamardzija mentioned.

@cvrebert cvrebert modified the milestones: v3.3.5, v3.3.4 Mar 15, 2015
@mdo
Copy link
Member

mdo commented May 14, 2015

Punting as a won't fix as well for now.

@mdo mdo closed this as completed May 14, 2015
@mdo mdo removed this from the v3.3.5 milestone May 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants