Page 1 of 1

Clean up my code

Posted: Wed Apr 29, 2009 8:05 am
by kastnerd
I have my old php/html site. With lots of instructions with tables and fonts and sizes.

I would like to clean up the code so its uses the styles correctly.

I have Dreamweaver CS3.

Anyone have suggestions on how to cleanup my code? Here is a sample of my ugly code.

Code: Select all

 <table>

	  <tr>
	  <td>
	  <font face="verdana" size="3"><b>
	  Detailed Installation Instructions
	  <br>
	  <br>
	  </b></font>	  </td>
	  </tr>
	  
	  <tr>

	  <td>
<TABLE BORDER=0 WIDTH="100%">
   <TR>
      <TD>         
	  <b><font color="red"><span class="style3">*Recommended</span>:</font><a href="/movieinstall.php"><FONT FACE="Arial" size="2"> Watch The Installation Instruction Movie</font></a></b>
         
	  <p class="style3"><span class="style4">What do I need before starting?</span><br>
             - Floor pump / Air compressor. (do not use mini pumps or C02 to inflate!)<br>

             - Plastic tire lever. (do not use screwdrivers, metal tire levers, or sharp tools!)<br>
             - Soap & water solution: Use a small bucket and mix 1/4 cup of liquid dish soap to 2 cups of water.<br>
             - Large brush with soft bristle to apply the soap & water solution.<br>
             - Cardboard box with open top or bucket. This is used in the sealing process (<strong>Photos 9, 10</strong>).<br>
             - Hand drill, 3/8" or 7/16" drill bit, small hand file for de-burring.<br><br>

             <span class="style4">1: Enlarging Valve Stem Hole</span><span class="style4">
			 <br>

Re: Clean up my code

Posted: Wed Apr 29, 2009 8:15 am
by mazhar

Re: Clean up my code

Posted: Wed Apr 29, 2009 10:25 am
by kastnerd
That did not remove much.
It still left me with

Code: Select all

<font face="verdana" size="3">
and

Code: Select all

<p class="style3">
I saw this post on another site that uses some sort of stripier. http://www.telerik.com/community/forums ... -html.aspx

I found if i take it in dreamwaver and select all and pick "none" for the format/front/style/size it removes basically everything.

Anyone have a quicker way to remove this?

Re: Clean up my code

Posted: Wed Apr 29, 2009 10:30 am
by mwolf
You could run your code through a HTML validation. This wont fix your code, but it will give you tips on how to clean it up.

http://validator.w3.org/#validate_by_input

Copy & Paste your code in the textarea, click more options and select your Doctype.