Author Topic: Simple text color question  (Read 151 times)

routinetrafficstop

  • New Member
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
Simple text color question
« on: May 18, 2012, 02:47:16 PM »
I have the following php code:

define('HEADING_TITLE',  'PLEASE NOTE - due to technical difficulties........');

I want that outputted text "please note....."  to display in red

Is there a way to add html tags or something of the sort to have this output in red?

Thanks for helping an extreme noobie :)

-Aaron



g0dzuki99

  • Regular Member
  • **
  • Posts: 78
  • Karma: 5
    • View Profile
    • www.chaoscontrol.org
Re: Simple text color question
« Reply #1 on: May 19, 2012, 10:03:53 AM »
PHP Code: [Select]
define('HEADING_TITLE',  '<span style="color:red";>PLEASE NOTE - due to technical difficulties........</span>');(

As long as HEADING_TITLE is being echoed or included in the output, the browser will respect the markup.
http://www.chaoscontrol.org
Have you minified your CSS/JS lately?

routinetrafficstop

  • New Member
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
Re: Simple text color question
« Reply #2 on: May 19, 2012, 02:42:09 PM »
I did what u requested and it ended up outputting that text and more above all the rest of the navigation bar etc... so it displayed it twice once in the right spot another at the very top above everything... and neither outputted in red...

Do i need to do an echo tag somewhere?  I'm very new with this so my apologies... I put in the code just like you had displayed and those were my results...

let me know if i can give any more info that is helpful!

Aaron

g0dzuki99

  • Regular Member
  • **
  • Posts: 78
  • Karma: 5
    • View Profile
    • www.chaoscontrol.org
Re: Simple text color question
« Reply #3 on: May 19, 2012, 08:31:19 PM »
Oops! Misplaced the semi-colon... should be red;" not red";  :-[

Try:

PHP Code: [Select]
define('HEADING_TITLE',  '<span style="color:red;">PLEASE NOTE - due to technical difficulties........</span>');

Then where ever you want it to appear in your template you'll need an echo... for example:

PHP Code: [Select]
echo '<h2>' HEADING_TITLE '</h2>';
//Outputs "PLEASE NOTE - due to technical difficulties........" (in red)
http://www.chaoscontrol.org
Have you minified your CSS/JS lately?