Advertisement
kobial8

Center an Image

Dec 24th, 2015
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 0.37 KB | None | 0 0
  1. 1. In HTML5, put img tag like this:
  2. <IMG class="displayed" src="..." alt="...">
  3.  
  4. 2. Then CSS3 should be:
  5. img.displayed {
  6.     display: block;
  7.     margin-left: auto;
  8.     margin-right: auto;
  9. }
  10.  
  11. 3. If you want to dynamic it in php then use image like this [MIND THE CLASS OF displayed!]:
  12. <?php the_post_thumbnail('blog', array('class' => 'img-responsive displayed')); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement