PDA

View Full Version : question about multi-use image



bazz
Jul 11th, 2009, 10:14 PM
Hi,

I am using an image comprising several images and I need to find the best way to use css to display the part of the image I want to show.

I can use this css for one instance but, should I have a different class label for the image which will have its own css and therefore show the correct part or, should I do some other thing.

Because I grabbed this css from another site, I don't understand the 'var' unless its a specific class used in JS, perhaps to vary which part of the image shows?



.image var { height:2.465em; margin-right:2px; padding-left:38px; background:url("/images/2.png") -476px -236px no-repeat; font-weight:bold; float:left;}



any pointers very welcome.

bazz

abduraooft
Jul 12th, 2009, 02:19 PM
var is an html tag (just knew now :)), see http://htmldog.com/reference/htmltags/var/

Take a look at http://www.google.com/#hl=en&q=google. That page shows a google log on the top left corner, but it actually http://www.google.com/images/nav_logo6.png. It uses an anchor tag to wrap that img tag, having the following CSS

#logo {
display:block;
height:37px;
margin:11px 0 7px;
overflow:hidden;
position:relative;
width:103px;
}