Posted By

kossmoss on 04/20/09


Tagged

float text images layout align


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

charmcitycoder


Cool CSS way to make left- or right-aligned (but not "styled" or "classed") images look pretty with no HTML change.


 / Published in: CSS
 

URL: http://www.idealweb.ru/layout/aligned-image-in-text-with-outer-css.html

When we can't or won't change the code of image tag with align attribute, but no 'style="margin: 0 10px 10px 0;' or 'hspace=10px' (IMHO, hspace makes bad looking layout in most cases) code within (just pure code), we can use simple CSS rules for such an images to make them good looking.

  1. CSS code:
  2.  
  3. img[align="left"]{ margin-right: 10px; margin-bottom: 10px; }
  4.  
  5. img[align="right"]{ margin-left: 10px; margin-bottom: 10px; }

Report this snippet  

You need to login to post a comment.