Image alignment Default WP


/ Published in: CSS
Save to your folder(s)

Used these styles to comply with default wordpress WYSIWYG class names


Copy this code and paste it in your HTML
  1. /******************************************
  2. * Align box
  3. ******************************************/
  4.  
  5. img.centered, .aligncenter, div.aligncenter {
  6. display: block;
  7. margin-left: auto;
  8. margin-right: auto;
  9. }
  10.  
  11. img.alignright {
  12. padding: 4px;
  13. margin: 0 0 2px 7px;
  14. display: inline;
  15. }
  16.  
  17. img.alignleft {
  18. padding: 4px;
  19. margin: 0 7px 2px 0;
  20. display: inline;
  21. }
  22.  
  23. .alignright {
  24. float: right;
  25. }
  26.  
  27. .alignleft {
  28. float: left;
  29. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.