Jump to content

increment on a css background?


Mr Chris

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.