Monday 28 April 2014

Best practice to show image button

Usually you create 2 different status of your button. one is normal image and the other one could be when mouse is hover over the image. If you want to show these images the best practice is to have both images merged into one image. You can use css to define which image should be used. in the following example you have an image that has both button image and you are selecting the left bottom one.
this is called image sprite. you merge number of images into one image therefore browser will load one image once and use that one image for different icons. It is very effective for image buttons and icons

#linkDemo a{
Display:block;
Float:left

Background: url(mybuttonsprite.jpg) no-repeat left bottom}

No comments:

Post a Comment