CSS class example for images

View previous topic View next topic Go down

CSS class example for images

Post by jamied_uk on 18th April 2014, 15:16

Code:
#content img.alignleft {display:inline; float:left; margin:5px 15px 5px 0;}
#content img.alignright {float:right; margin:5px 0 5px 15px;}
#content img.aligncenter {display:block; margin:10px auto;}
#content img.border {background:#ccc; border:4px solid #f0f0f0; color:#333; padding:1px;}


Adding the alignment class

The sample image in the content of the Variant Creative template is shown using this image tag in the file index.html:


Code:

<img class="alignright" src="img/test.jpg" height="225" width="300"
alt="Example content image using the class .alignright" />







~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Custom stle class for images

The css class will be like this:


img.class-alpha
{background:#ccc; border:4px solid #f0f0f0; color:#333; padding:1px;}




html5 example:

alt="Example content image using the class " />
avatar
jamied_uk
Admin

Posts : 2243
Join date : 2010-05-09
Age : 34
Location : UK

http://address-shortner.co.uk

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum