roldahayes Posted January 7, 2010 Share Posted January 7, 2010 Hey, this code echos all in black - how can I change the colour of 'radius' and 'zip' to red? <?PHP echo $_POST['radius'], ' miles of ', $_POST['zip'] ?> Quote Link to comment Share on other sites More sharing options...
Mchl Posted January 7, 2010 Share Posted January 7, 2010 http://en.wikipedia.org/wiki/Cascading_Style_Sheets Quote Link to comment Share on other sites More sharing options...
haku Posted January 8, 2010 Share Posted January 8, 2010 Please don't use php in the HTML and/or CSS sections. PHP is irrelevant to HTML and CSS, all that matters is the HTML output. Quote Link to comment Share on other sites More sharing options...
soycharliente Posted January 11, 2010 Share Posted January 11, 2010 If you're trying to show that code on your page but with different colors than the default, you'll need to apply some kind of tag and most likely want to use a class. You probably want to look into using htmlspecialchars() as well if you want to output code in HTML. But this is the CSS forum, so switch to PHP if you're having trouble with that. CSS: span.red { color: #F00; } HTML: <?php echo $_POST['<span class="red">radius</span>'], ' miles of ', $_POST['<span class="red">zip</span>']; ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.