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 causing text-center not to work #10308

Closed
jeffcorey opened this issue Aug 30, 2013 · 2 comments
Closed

Img Responsive class causing text-center not to work #10308

jeffcorey opened this issue Aug 30, 2013 · 2 comments
Labels

Comments

@jeffcorey
Copy link

Could not find this as an open or resolved issue, but is anyone else having a problem with the img-responsive class not allowing text-center to work?

@andyvincent
Copy link

I've had the same issue - I think this is by design though - looking at the images, they effectivly are 100% width (caused by the max-width attribute being 100%) - There is away around this though, and that is to set margin-left and margin-right to auto on your image. I created a selector called img-center and applied it to the image -

.img-center {
  margin-left: auto;
  margin-right: auto;
}

<img class="img-responsive img-center" src="/img/content/garrison-1-sm.jpg" title="A group of volunteers at the Fort in formation">

@cvrebert
Copy link
Collaborator

Per its name, .text-center isn't guaranteed to work for non-text in the general case (although it might work in certain cases).

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

No branches or pull requests

3 participants