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.img-responsive wrapped in div.center-block does not align #11478

Closed
jdd2405 opened this issue Nov 13, 2013 · 2 comments
Closed

img.img-responsive wrapped in div.center-block does not align #11478

jdd2405 opened this issue Nov 13, 2013 · 2 comments
Labels

Comments

@jdd2405
Copy link

jdd2405 commented Nov 13, 2013

The css of the following html needs to be fixed as shown below:
HTML:

<div class="center-block">
<img src="img/file.png" class="img-responsive" alt="Responsive Image">
</div>

CSS-FIX:

.center-block .img-responsive {margin: 0 auto;}
@carasmo
Copy link

carasmo commented Nov 14, 2013

I believe you're supposed to put that on the image

<img src="img/file.png" class="img-responsive center-block" alt="Responsive Image">

http://bootply.com/94007

.center-block {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

If .center-block was supposed to be a wrapper, it would have a text-align:center inside it, I would think.

@mdo
Copy link
Member

mdo commented Dec 1, 2013

Yup, use it on the element that is meant to be centered.

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