Skip to content
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

.img-responsive class breaks table with fixed widths in FF #10690

Closed
bassjobsen opened this issue Sep 17, 2013 · 11 comments
Closed

.img-responsive class breaks table with fixed widths in FF #10690

bassjobsen opened this issue Sep 17, 2013 · 11 comments

Comments

@bassjobsen
Copy link
Contributor

See: http://jsfiddle.net/cctyb/ (original: http://stackoverflow.com/questions/18846744/responsive-images-in-tables-bootstrap-3/1885903).

Possible solution seems add:
.table .img-responsive{width:100%} to the css / less, see: http://stackoverflow.com/questions/2923710/why-do-firefox-and-opera-ignore-max-width-inside-of-display-table-cell

@mdo
Copy link
Member

mdo commented Oct 21, 2013

This seems more like browser bugs to me than a Bootstrap bug. The .img-responsive class sets images to inline-block and if the table doesn't respect that, the browser should fix it. Can you file a bug against Firefox for this?

Depending on the answer, we can revisit adding this as a note to the Browser compatibility docs section.

@mdo mdo closed this as completed Oct 21, 2013
@cvrebert
Copy link
Collaborator

@bassjobsen So, did you file a bug against Firefox, or do we still need to file one?

@cvrebert cvrebert reopened this Feb 14, 2014
@bassjobsen
Copy link
Contributor Author

Sorry, i can't remember. I think i did, but i can't find it again for now. Sorry.

@mdo
Copy link
Member

mdo commented Feb 22, 2014

@mdo mdo closed this as completed Feb 22, 2014
@mdo mdo mentioned this issue Feb 22, 2014
@cvrebert
Copy link
Collaborator

@mdo <3

@zessx
Copy link

zessx commented Feb 24, 2014

Workaround, pending correction : add .col-xs-12 to your .img-responsive.

@emaildano
Copy link

@zessx, and all. For a workaround that fits well into your existing markup here's a fix via LESS.

.img-responsive {
.make-xs-column(12);
}

@emaildano
Copy link

Correction

That works but could add extra padding on your images. Here's an update to that LESS fix.

.img-responsive {
.make-xs-column(12; @gutter: 0);
float: none;
}

That applies all the extra necessary CSS and zeros out the extra padding.

@Gorli
Copy link

Gorli commented Oct 23, 2014

You can also temporarily use this trick: http://css-tricks.com/snippets/css/css-hacks-targeting-firefox/

EXAMPLE:

/* only Firefox */
@-moz-document url-prefix() {
.img-responsive, .thumbnail>img, .thumbnail a>img, .carousel-inner>.item>img, .carousel-inner>.item>a>img {
width: 100%;
}
}

@gvilcins
Copy link

Try adding:
table .img-responsive {
width: 100%;
}

Seemed to work for me...

@twbs twbs locked and limited conversation to collaborators Jan 15, 2015
@cvrebert
Copy link
Collaborator

A fix for the bug should land in Firefox 46: http://bugzil.la/823483
(Refs #19155)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants