Jump to content

How can I mix a font tag with php database variables?


AlexanderBlade

Recommended Posts

Hi everyone, I'm trying to get my head around blending in and out of php and html.  I've seen some simple examples which work great but now I have this variable that comes from the database and I would like to style the variable in-line with html markup.

 

Here's what I'm trying to do:

 

<?php

 

 echo "Price : ",'<Font size="100"> $tournament["pricePerPlayer"] </font>';

....more of the same code goes here...

 

?>

 

I can't get $tournament["pricePerPlayer"] to be controlled by the font tag.  How do I do this?

Any help would be greatly appreciated.

 

Thanks,

The <font> tag has been deprecated from HTML5, so you really shouldn't use it. You should be using CSS to control your visual presentation. You also have mismatched font tags (opening starts with upper-case, closing is all lower-case.

echo 'Price: <span style="font-size:50px">' . $tournament["pricePerPlayer"] . '</span>';

Ultimately it would REALLY be best to use a stylesheet, and then just give the span an ID or a classname, with the style for that ID/Classname defined in the stylesheet.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.