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

IE9-11 img-circle error when also applying padding to image. #14259

Closed
EvoTech3 opened this issue Jul 28, 2014 · 7 comments
Closed

IE9-11 img-circle error when also applying padding to image. #14259

EvoTech3 opened this issue Jul 28, 2014 · 7 comments

Comments

@EvoTech3
Copy link

http://jsfiddle.net/9EZ4H/3/

Tested on: IE11, IE10, IE9, IE8, Safari for Win 5.1.7

@cvrebert
Copy link
Collaborator

Per our browser compatibility table, Safari for Windows is not supported.

@cvrebert cvrebert changed the title IE & Safari border-radius error when applying padding to image. IE8-11 border-radius error when applying padding to image. Jul 28, 2014
@cvrebert cvrebert added the css label Jul 28, 2014
@cvrebert cvrebert changed the title IE8-11 border-radius error when applying padding to image. IE9-11 border-radius error when applying padding to image. Jul 28, 2014
@cvrebert
Copy link
Collaborator

Confirmed on IE9-11.
Our docs already mention that IE8 doesn't support rounded corners at all.

@EvoTech3 This issue is only about .img-circle, correct?

@EvoTech3
Copy link
Author

@cvrebert yes

@cvrebert cvrebert added this to the v3.2.1 milestone Jul 28, 2014
@cvrebert cvrebert changed the title IE9-11 border-radius error when applying padding to image. IE9-11 img-circle error when also applying padding to image. Jul 28, 2014
@KyleMit
Copy link
Contributor

KyleMit commented Jul 30, 2014

This looks like it's related to #10122, both of which might fall out of scope for fixing with the default bootstrap library.

It's merely a byproduct of applying both padding and a border-radius to the same element in some browsers. The border-radius changes the curvature of the border component of the box model, which surrounds the padding component.

box-model

Even though the browser has given the border a circular curve, the margin and padding elements are still represented as rectangles. In some browsers, the border-radius curve is not propagated to other box model components.

Here's how it looks in chrome and in IE without any fixes:

screenshot

Here's a fiddle that demonstrates the issue

If you're looking for fixes, you can do one of two things:

  1. You can just add a wrapper around your image and apply the padding to the wrapper.
  2. Apparently adding a border line to the element prevents the issue. If you don't want to see the border, you could use border: 1px solid transparent

Also shows up in this Stack Overflow question about Border-radius and padding not playing nice.

@mdo
Copy link
Member

mdo commented Aug 2, 2014

Don't think there's anything we can do. Wrapping the element is your best bet.

@mdo mdo closed this as completed Aug 2, 2014
@hackpron
Copy link

hackpron commented Sep 8, 2016

in IE9 any of code is not working to circle image...

@Alpdog14
Copy link

I am having issues with img-circle on IE9-11, has anyone figured out a solution?

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

6 participants