
Originally Posted by
LAMA
Not really sure if this is the right topic to put this into, but I was wondering all over I see 'you should clean up your code', 'it will load faster if you clean it up'. I was just wondering how do you go about 'cleaning your code' and does it actually make the page load faster?
When somebody says "clean up code" it probably means that the code is a mess and there are a lot of tags that aren't really doing anything. Example:
HTML Code:
<table width="100%" border="0" cellpadding="10" cellspacing="0">
<tr>
<td width="100%">
<font face="Verdana"><font size="3"><font color="red"><b>Hello</b></font></font></font>
</td>
</tr>
</table>
This is obviously a bad example, but bear with me.
That code above can easily be translated into something like this:
HTML Code:
<div style="padding: 10px; font: bold 15px Verdana, Arial, Helvetica, sans-serif; color: red;">Hello</div>
There is far less code in the second example than in the first even though they both give the same effect. Doing this will make your file size that much smaller. Smaller file sizes = faster loading pages.
Bookmarks