![]() |
Sprite addition help
Hi all, i'm trying to replace all my forum images with a sprite reference, most of my images are on forumhome, could someone help with how i'd present the css instead of this
HTML Code:
<td><img src="$stylevar[imgdir_statusicon]/$forum[imageprefix]forum_$forum[statusicon].gif" alt="" border="0" height="46px" width="46px" id="forum_statusicon_$forum[forumid]" /> Quote:
HTML Code:
#td { Any help is appreciated :) EDIT: the image names in the css i.e Accessforum_old are the names of the prefixes as they are currently in use. |
You basically tell it where the upper left point is via x y position and then give the height and width from there.
http://www.w3schools.com/css/css_image_sprites.asp |
I've had limited success using <td id="td"> but it just shows the entire sprite, even if i then do <td id="td" class="$forum[imageprefix]forum_$forum[statusicon]"> i cant get it to show that particular part of the sprite, just using $forum[imageprefix]forum_$forum[statusicon] in the template shows the correct name for the sprite portion but no image?
--------------- Added [DATE]1367557259[/DATE] at [TIME]1367557259[/TIME] --------------- i've made further modifications and have much better success although some of the images aren't showing correct and i think thats down to the generated image and css, i'll have a play now that i can actually see whats going on - thanks Lynne :) |
Part of the problem may be that IDs have to be unique on a page. It appears that you're trying to have a <td id="td"> for each row in your forumhome table.
Put the {background: url(forumsprite.png) no-repeat top left;} into each of the class definitions and eliminate the #td selector altogether. You might also try putting some content into the td— like a Table cells act weirdly when they are empty. --don |
All times are GMT. The time now is 07:12 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|