Can anyone help me what is the correct syntax for this:
echo "<div style = \"color:red;\"> Created</div>";
I want the 'Created' text will be coloured red. But don't think this is correct way to do it. Anyone can help?
That should work, but it actually has little to do with PHP despite being a line of PHP code. Personally, I would write:
echo '<div style="color: red;"> Created</div>';
Hi laserlight,
Yes I thought it would work but it didn't - I tried yours but the text still unchanged...😕😕
Is that anything to do with my version?
It quick check shows that it does work for me. The HTML and CSS is simple enough that it must work, since it is correct by inspection and in my quick test.
Hmmm this is odd....it did show the text but the colour didn't change to red - Oh well thanks for the inputs anyway.._
You could post a complete HTML page that demonstrates the problem. To keep it simple, don't use any PHP. Also state your web browser version.
Thanks laserlight, it sorted now - I don't know what has happened before prolly just my silly mistake hehe.. Thanks!
You're welcome! Yeah, coming up with the simplest example that demonstrates the problem is often a good way of discovering what is wrong and figuring how to fix it.
Remember to mark this thread as resolved using the thread tools 🙂