Mr Chris Posted July 30, 2008 Share Posted July 30, 2008 Hi All, Don't know if this is possible using PHP or not. I have a CSS file: <style> #line_up li { background:#FFF url(1.jpg) no-repeat 0 5px; padding-left: 25px; padding-top: 1px; font-size:12px; font-weight:bold; height:22px; top:-2px; } </style> <div id="line_up"> <ul> <li><a href="../profiles/player.php?player_id=33" class="blue_hyper">Player One</a></li> <li><a href="../profiles/player.php?player_id=17" class="blue_hyper">Player Two</a></li> <li><a href="../profiles/player.php?player_id=34" class="blue_hyper">Player Three</a></li> </ul> </div> And what I want to do in php is increase the .jpg value by one (maybe using i++) : background:#FFF url(1.jpg) no-repeat 0 5px; So Player One's Background is 1.jpg Player two's background is 2.jpg Player three's background is 3.jpg etc... But can this be done using a background in CSS? Thanks Link to comment https://forums.phpfreaks.com/topic/117386-increment-on-a-css-background/ Share on other sites More sharing options...
DarkWater Posted July 30, 2008 Share Posted July 30, 2008 You'd need a new style for every player which would be annoying for people with low-speed internet connections to download every time. Link to comment https://forums.phpfreaks.com/topic/117386-increment-on-a-css-background/#findComment-603814 Share on other sites More sharing options...
Jabop Posted July 30, 2008 Share Posted July 30, 2008 Or you could do inline styles, which are fail, but will solve the problem. Link to comment https://forums.phpfreaks.com/topic/117386-increment-on-a-css-background/#findComment-603855 Share on other sites More sharing options...
DarkWater Posted July 30, 2008 Share Posted July 30, 2008 Or you could do inline styles, which are fail, but will solve the problem. Yeah I was going to suggest those too until I thought about the failure involved. =( Link to comment https://forums.phpfreaks.com/topic/117386-increment-on-a-css-background/#findComment-603862 Share on other sites More sharing options...
rhodesa Posted July 30, 2008 Share Posted July 30, 2008 you have to use inline styles, or a separate class for each LI. 'style wise', the three LI elements are identical, so they should be the same. Link to comment https://forums.phpfreaks.com/topic/117386-increment-on-a-css-background/#findComment-603863 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.