Originally Posted by
CarlC
I thought there was a way to have a color specified when using echo, but the only one I found didn't work.
There is.
Try this:
Code:
<!--bof-display today date and time-->
<?php
echo "<div style=\"color:white\">" ;
echo date('l jS F Y - h:ia');
echo "</div>" ;
?>
<!--eof-display today date and time-->
There ARE better ways to do this (such as "<div class='xxxxx'> or '<div id=xxxxx>' and then adding this new class/id to your stylesheet, but for a quick n dirty fix, the inline style should work ok.
I suspect the other changes I suggested had no effect due to where the change was made. However, my second suggestion did have the desired effect when I tried it.
Anyway, handy hint time. If you install Firefox (or Chrome) with the developer plugin, you can right-click on any page element (such as where your date/time display is) then 'Inspect Element' you'll be greeted with a .css editor of sorts. Although it can look daunting at first with a bit of playing around you'll start to realise exactly what you are looking at, and you can start to make many changes in regards to how the site looks. If you screwup (and you will), just refresh the page and start again. The changes you make won't be permanent, so when you DO find what you want, just take note of the stylesheet (and line#) and then manually apply the same changes to the actual file.
Be careful though. Playing with the .css on a live site can be very addictive (and fun). :)
Cheers
Rod
Bookmarks