JMair Posted August 13, 2009 Share Posted August 13, 2009 I need to display Red and Green links on the same page. Can this be done within a single php page? Link to comment https://forums.phpfreaks.com/topic/170143-solved-unique-color-for-links/ Share on other sites More sharing options...
TeNDoLLA Posted August 13, 2009 Share Posted August 13, 2009 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>'; Link to comment https://forums.phpfreaks.com/topic/170143-solved-unique-color-for-links/#findComment-897493 Share on other sites More sharing options...
mikesta707 Posted August 13, 2009 Share Posted August 13, 2009 you can style the links with php if you want... Link to comment https://forums.phpfreaks.com/topic/170143-solved-unique-color-for-links/#findComment-897495 Share on other sites More sharing options...
JMair Posted August 13, 2009 Author Share Posted August 13, 2009 Thanks a ton. Found what I needed from your suggestions here http://www.w3schools.com/css/tryit.asp?filename=trycss_link2 Link to comment https://forums.phpfreaks.com/topic/170143-solved-unique-color-for-links/#findComment-897548 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.