smeeb
smeeb

Reputation: 29567

Bootstrap 3: Centering an image

Here is my jsFiddle with full code example.

I couldn't figure out how to upload my placeholder.png image and so it appears broken, but nevertheless, I am trying to figure out how to get it centered underneath the <h3> tag. My attempt to center it:

<image src="placeholder.png" style="text-align: center;" />

...isn't working for some reason. Any idea as to why?

Upvotes: 1

Views: 48

Answers (2)

the_pantless_coder
the_pantless_coder

Reputation: 2297

here you go - easy way of doing it.

http://jsfiddle.net/kLzah1x4/2/

    <h3 style="text-align: center;">    
      <img src="placeholder.png"/>
    </h3>

Upvotes: 1

dfsq
dfsq

Reputation: 193311

Add class text-center to parent container and remove style="text-align: center;" from image, it's not needed:

<div class="col-md-12 text-center">
    ...
    <img src="placeholder.png" />
</div>

Demo: http://jsfiddle.net/kLzah1x4/1/

Upvotes: 3

Related Questions