Jump to content

[SOLVED] Unique Color for links


JMair

Recommended Posts

I think this is more of a CSS problem than php. You can though, assign CSS styles dynamically with php.

 

<html>
<head>
.green {
  color: green;
}

.red {
  color: red;
}
</head>
<body>
<a href="#" class="green">Green link</a>
<a href="#" class="red">Red link</a>
</body>
</html>

 

with php..

<?php
$class = 'green';
echo '<a href="#" class="'. $class .'">Green link</a>';
$class = 'red';
echo '<a href="#" class="'. $class .'">Red link</a>';

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.