using css in echo text output

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ringartdesign
Forum Newbie
Posts: 21
Joined: Wed Sep 10, 2008 10:11 am

using css in echo text output

Post by ringartdesign »

I'd like the$quote section of this statement to output a bold, 28 pt font in lime green. I'd also like the "per month" to be in the same color green but 14 pt and not bold. For some reason this statement doesn't work:

echo "<p style="font-size:28px;color:99CC00;">$".$quote."</p><br>per month";

Thanks!!
marcth
Forum Contributor
Posts: 142
Joined: Mon Aug 25, 2008 8:16 am

Re: using css in echo text output

Post by marcth »

If you want to do HTML, then do HTML :)

Code: Select all

 
<p>
  <span style="font-size:28px; color:99CC00;">$<?= $quote?></span> per month
</p>
 
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: using css in echo text output

Post by califdon »

ringartdesign wrote:I'd like the$quote section of this statement to output a bold, 28 pt font in lime green. I'd also like the "per month" to be in the same color green but 14 pt and not bold. For some reason this statement doesn't work:

echo "<p style="font-size:28px;color:99CC00;">$".$quote."</p><br>per month";

Thanks!!
Try:

Code: Select all

echo "<p style='font-size:28px; color:#99CC00;'>$quote<br />";
echo "<span style='font-size:14px;'>per month</span></p>";
 
ringartdesign
Forum Newbie
Posts: 21
Joined: Wed Sep 10, 2008 10:11 am

Re: using css in echo text output

Post by ringartdesign »

Thank you it works perfectly!!!
Post Reply