This might sound like a silly question but how would I make this code seem…neater?
echo "<h3><font face='helvetica'><font size='4'><b><font color='B80000'>$title</font></font></font></b> <font color='A0A0A0'>$category </font><font color='A0A0A0'><a href='profile.php?id=$userid'>$user</a></font>
<font face='helvetica'><font size='3'><br> $desc</font></font><br>
<h3><font color='101010'> $city,$state $zip <font color='A0A0A0'>$date</font> </font></h3>";
?>
There’s nothing wrong with the code but it looks so sloppy – I was wondering if someone could help me out with making it look neat and tidy
<font>– move those rules to CSS, where you can style the<h3>element. Also! Not all computers have Helvetica, so you may want to change that to"Helvetica", Arial;so the design stays somewhat inline with your intent.<h3>twice – put the second h3 into a<p>or something similar, and use CSS to style that. $city,$state $zip is dirty – concatenate the string with spaces in PHP, then echo the string.echoinside of the HTML for the certain elements – this will make it much more readable.htmlspecialchars()on every piece of data that comes out of a database before you echo it to the page. This prevents invalid HTML and XSS vulnerabilities.That should tighten it up!