Posted By

kurai on 09/09/07


Tagged

image align


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

luman
basicmagic
j_junyent
kantiano


Image Align


 / Published in: CSS
 

Simple CSS to easily align images in blogs and personal sites.

  1. img.centered {
  2. display: block;
  3. margin-left: auto;
  4. margin-right: auto;
  5. }
  6.  
  7. img.alignright {
  8. padding: 4px;
  9. margin: 0 0 2px 7px;
  10. display: inline;
  11. }
  12.  
  13. img.alignleft {
  14. padding: 4px;
  15. margin: 0 7px 2px 0;
  16. display: inline;
  17. }
  18.  
  19. .alignright {
  20. float: right;
  21. }
  22.  
  23. .alignleft {
  24. float: left
  25. }

Report this snippet  

You need to login to post a comment.