I posted my original issue a while ago, back here:
CSS/PHP - Overlaying an Image with Hover and If Statements
Since then, I've fixed my main issue, and am now left with one more. The code which returns the server looks like this:
<?php
foreach($servers as $server):
$stats = \Minecraft\Stats::retrieve(new \Minecraft\Server($server));
?>
<center>
<pre>
<div class="server">
<div class="overlay"></div>
<div class="<?php echo($stats->is_online) ? 'online' : 'offline'; ?>"></div>
<div class="numbers"><?php printf('%u/%u', $stats->online_players, $stats->max_players); ?></div>
</div>
</pre>
</center>
As you can see, all of these servers are under one CSS "server" class. This is posing problems, as I need each server returned to have different images.
Here is the CSS for the server class:
.server {
background: url('img/servers/hg.png') center no-repeat;
width: 330px;
height: 280px;
overflow: hidden;
position: relative;
}
.server:hover {
background: url('img/servers/hg-hover.png') center no-repeat;
}
How can I select the individual servers, or make a list of CSS to be executed?
Thanks!