html - How to center only one div inside a div and leave the rest as-is -


the image inside image-video-linkmas has horizontally centered. can achieve adding text-align:center div .article. however, inside centered horizontally dont want. how center image , leave else as-is? tried .article .image-video-linkmas img {text-align:center} didnt work.

<div class="article">          <article class="item single_masonary_item active">              <div class="masonary_item_inner">                  <div class="image-video-linkmas">                      <a href="" target="_blank"><img alt=                      "#" src="http://lorempixel.com/100/100"></a>                  </div>              </div>          </article>      </div>

you can center image this:

img{   display:block;   margin: 0 auto; } 

example:

http://codepen.io/nilestanner/pen/qabjap


Comments