PC & IT SUPPORT MADE EASY FORUM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

CSS class example for images

Go down

CSS class example for images Empty CSS class example for images

Post by jamied_uk 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 " />
jamied_uk
jamied_uk
Admin

Posts : 2951
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Back to top

- Similar topics

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