Font size in PHP?

GigaGreg

Moderator
Staff member
First method is a proper one, when you build a pure php website, the second one when html with php elements.

If you want to do it properly you should do:

when you have <?php before <html> and ?> after </html>
PHP:
echo " <div style="font-size:36px">Powered by <a href="#">url</a>. </div> // between " " put wrapped div with css attributes and it should work
 "

or simply you can do when you have <?php before <html> and ?> after </html>

PHP:
<div style="font-size:36px">Powered by <a href="#">url</a>. </div>
 

un4saken

Administrator
PHP:
<?php
// some php code
 ?>
<div style="font-size:18px">text</div> 
 <?php
// more php code
 ?>

or
PHP:
 <?php
 echo '<div style="font-size:18px">text</div>';
 ?>
 

Zephyron

New member
To be completely correct on a syntax level, you should use a span tag instead of the div. Div is primarily for block-level elements, span is for in-line elements (like changing a line of text).

Using div tags could cause it to display oddly if there is a CSS component that changes the display of all div tags.

For TOTAL web grammar fanatics, you should really add a CSS class to your stylesheet for the span, then reference the class/id in the code.