<html><!-- #BeginTemplate "/Templates/layout-articles.dwt" -->
<!-- DW6 --> 
<head>
<!-- #BeginEditable "doctitle" --> 
<title>The Three Principles Of HTML Code Optimization</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META NAME="title" content="The Three Principles Of HTML Code Optimization">
<META NAME="description" content="The Three Principles Of HTML Code Optimization">
<META NAME="keywords" content="html, web page, free web templates, web template, site layouts, page layouts, page sets, graphic sets, web design, linkware, money, financial, floral, computer, hi tech, technology, skyline, building, patriotic, american, flag, automotive, christmas, baby, restaurant, halloween, sports, business">
<META NAME="rating" content="general">
<META NAME="distribution" CONTENT="global">
<META NAME="resource-type" CONTENT="document">
<META NAME="last-modified" CONTENT="2007/09/26">
<META NAME="robots" content="index,follow">
<META NAME="revisit-after" content="10_days">
<!-- #EndEditable --> 
<LINK REL=stylesheet HREF="http://www.afreewebtemplate.com/style.css" TYPE="text/css">
<script language="javascript">
function mailpage()
{
mail_str = "mailto:?subject=Check out this page called " + document.title;
mail_str += "&body=I thought you might be interested in this page called " + document.title;
mail_str += ". You can view it at, " + location.href.toString(); 
location.href = mail_str;
}
</script>
</head>
<body bgcolor="#E6E6FF" topmargin="0">
<STYLE type="text/css">
<!--
BODY
{
scrollbar-face-color: #001F5B;
scrollbar-highlight-color: #FFFFFF;
scrollbar-3dlight-color: #001F5B;
scrollbar-darkshadow-color: #001F5B;
scrollbar-shadow-color: #001F5B;
scrollbar-arrow-color: #BECFF1;
scrollbar-track-color: #BECFF1;
}
-->
</STYLE>
<!-- Kontera ContentLink™  --> 
<script type="text/javascript">
var dc_UnitID = 14;
var dc_PublisherID = 11120;
var dc_AdLinkColor = 'blue';
var dc_adprod='ADL';
</script>
<script type="text/javascript" src="http://kona.kontera.com/javascript/lib/KonaLibInline.js"></script>
<!-- Kontera ContentLink™  --> 
<table border="0" cellpadding="0" cellspacing="0" width="1000" align="center">
  <tr> <!-- Shim row, height 1. --> 
    <td><img src="../images/shim.gif" width="202" height="1" border="0"></td>
    <td><img src="../images/shim.gif" width="201" height="1" border="0"></td>
    <td><img src="../images/shim.gif" width="468" height="1" border="0"></td>
    <td><img src="../images/shim.gif" width="129" height="1" border="0"></td>
    <td><img src="../images/shim.gif" width="1" height="1" border="0"></td>
  </tr>
  <tr valign="top"> <!-- row 1 --> 
    <td colspan="4"><img name="layout_r1_c1" src="../images/layout_r1_c1.gif" width="1000" height="21" border="0"></td>
    <td><img src="../images/shim.gif" width="1" height="21" border="0"></td>
  </tr>
  <tr valign="top"> <!-- row 2 --> 
    <td rowspan="2" colspan="2"><a href="../index.html"><img name="layout_r2_c1" src="../images/layout_r2_c1.gif" width="403" height="90" border="0" alt="Home"></a></td>
    <td> 
      <div align="center"><a href="http://www.hooverwebdesign.com/flash_albums.html" target="_blank"><img name="layout_r2_c3" src="../images/468x60_flash_gallery.gif" width="468" height="60" border="0" alt="Flash Photo Gallery"></a></div>
    </td>
    <td rowspan="2"><img name="layout_r2_c4" src="../images/layout_r2_c4.gif" width="129" height="90" border="0"></td>
    <td><img src="../images/shim.gif" width="1" height="60" border="0"></td>
  </tr>
  <tr valign="top"> <!-- row 3 --> 
    <td><img name="layout_r3_c3" src="../images/layout_r3_c3.gif" width="468" height="30" border="0"></td>
    <td><img src="../images/shim.gif" width="1" height="30" border="0"></td>
  </tr>
  <tr valign="top"> <!-- row 4 --> 
    <td colspan="4"><img name="layout_r4_c1" src="../images/layout_r4_c1.gif" width="1000" height="41" border="0" usemap="#hoover_r2_c2Map"> 
      <map name="hoover_r2_c2Map"> <area shape="rect" coords="826,1,920,27" href="../links.html" alt="Related Links" title="Related Links"> 
        <area shape="rect" coords="730,-2,824,28" href="../resources.html" alt="Web Design Articles" title="Web Design Articles"> 
        <area shape="rect" coords="633,1,728,29" href="index.html" alt="Premium Web Templates" title="Premium Web Templates"> 
        <area shape="rect" coords="439,3,535,29" href="../terms.html" alt="Template Terms of Use" title="Template Terms of Use"> 
        <area shape="rect" coords="348,-2,438,26" href="../free-templates1.html" alt="Free Web Templates" title="Free Web Templates"> 
        <area shape="rect" coords="250,2,344,28" href="../index.html" alt="A Free Web Template Home" title="A Free Web Template Home"> 
        <area shape="rect" coords="538,1,632,29" href="../freegraphics/index.html" alt="Free Web Templates" title="Free Web Templates"> 
      </map></td>
    <td><img src="../images/shim.gif" width="1" height="41" border="0"></td>
  </tr>
  <tr valign="top"> <!-- row 5 --> 
    <td colspan="4"><img name="layout_r5_c1" src="../images/layout_r5_c1.gif" width="1000" height="1" border="0"></td>
    <td><img src="../images/shim.gif" width="1" height="1" border="0"></td>
  </tr>
  <tr valign="top"> <!-- row 6 --> 
    <td background="../images/layout_r6_c1.gif" bgcolor="#FFFFFF"> 
      <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr background="../images/layout_r6_c1.gif" valign="top"> 
          <td> 
            <table width="100%" border="0" cellspacing="1" cellpadding="0" bordercolor="#CCCCCC" bordercolorlight="#999999" bordercolordark="#666666">
              <tr> 
                <td colspan="2" bgcolor="#6699CC"><b><font color="#FFFFFF">Freebies</font></b></td>
              </tr>
              <tr> 
                <td bgcolor="#6699CC" width="1%" height="20">&nbsp;</td>
                <td width="99%" height="20"> <a href="../free-templates1.html">Free 
                  Web Templates</a> </td>
              </tr>
              <tr> 
                <td width="1%" bgcolor="#6699CC">&nbsp;</td>
                <td width="99%"><a href="../freegraphics/index.html">Free Web Graphics</a></td>
              </tr>
              <tr> 
                <td width="1%" bgcolor="#6699CC">&nbsp;</td>
                <td width="99%"><a href="index.html">Free Web Design 
                  Articles</a></td>
              </tr>
            </table>
            <table width="100%" border="0" cellspacing="1" cellpadding="0" bordercolor="#CCCCCC" bordercolorlight="#999999" bordercolordark="#666666">
              <tr> 
                <td colspan="2" bgcolor="#6699CC"><b><font color="#FFFFFF">Help 
                  &amp; Information</font></b></td>
              </tr>
              <tr> 
                <td bgcolor="#6699CC" width="1%" height="20">&nbsp;</td>
                <td width="99%" height="20"><a href="../index.html">Home</a></td>
              </tr>
              <tr> 
                <td bgcolor="#6699CC" width="1%" height="20">&nbsp;</td>
                <td width="99%" height="20"> <a href="../terms.html">Terms of Use</a></td>
              </tr>
              <tr> 
                <td width="1%" bgcolor="#6699CC">&nbsp;</td>
                <td width="99%"><a href="http://www.hooverwebdesign.com/templates">Premium 
                  Web Templates</a></td>
              </tr>
              <tr> 
                <td bgcolor="#6699CC">&nbsp;</td>
                <td><a href="../link-exchange.html">Link Exchange Form</a></td>
              </tr>
              <tr> 
                <td width="1%" bgcolor="#6699CC">&nbsp;</td>
                <td width="99%"><a href="../website-builders.html">Online Website 
                  Builders</a></td>
              </tr>
              <tr> 
                <td width="1%" bgcolor="#6699CC">&nbsp;</td>
                <td width="99%"><a href="../resources.html">Website Resources</a></td>
              </tr>
              <tr> 
                <td width="1%" bgcolor="#6699CC">&nbsp;</td>
                <td width="99%"><a href="../links.html">Web Links</a></td>
              </tr>
              <tr> 
                <td width="1%" bgcolor="#6699CC">&nbsp;</td>
                <td width="99%"><a href="../contact.html">Contact Us</a></td>
              </tr>
            </table>
            
          </td>
        </tr>
      </table>
    </td>
    <td bgcolor="#FFFFFF" colspan="3"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="5">
        <tr> 
          <td> 
            <div align="center"></div>
            <table width="100%" border="0" cellspacing="0" cellpadding="5" bgcolor="#FFFFFF">
              <tr> 
                <td width="50%"> 
                  <p>&nbsp; <img src="../images/icon-book.gif" width="29" height="29" align="absmiddle"> 
                    Learn Website Design Tricks and Tips. <a href="http://www.afreewebtemplate.com/articles/">Click 
                    here</a>.</p>
                </td>
                <td width="50%" valign="bottom"> 
                  <div align="right"> </div>
                  </td>
              </tr>
            </table>
            <div align="center"> </div>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td valign="top"> 
                  <div align="center"> </div>
                  </td>
              </tr>
            </table>
            <table width="98%" border="0" cellspacing="0" cellpadding="5" bordercolor="#CC6666" align="center">
              <tr valign="top"> 
                <td> 
                  <div align="center"> 
                    <h1>Free Website Design Web Templates<b><font face="Arial, Helvetica, sans-serif"><b><font face="Arial, Helvetica, sans-serif"><font size="2"><br>
                      <br>
                      </font><b><font face="Arial, Helvetica, sans-serif"><font size="2"><img src="../images/icon-article.gif" width="18" height="16" align="absmiddle"> 
                      <a href="index.html">Related articles</a> <img src="../images/icon-graphics.gif" width="18" height="16" align="absmiddle"> 
                      <a href="../freegraphics/index.html">Add graphics to your 
                      template</a> <img src="../images/icon-friend.gif" width="18" height="16" align="absmiddle"> 
                      <a href="javascript:mailpage()">Send this page to a friend</a> 
                      <br>
                      <script type="text/javascript"><!--
google_ad_client = "pub-8746590042519546";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
//2008-01-21: myprintablegreetings.com
google_ad_channel = "6444342160";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_text = "000000";
google_color_url = "0000FF";
//-->
</script>
                                            <script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
                      </font></font></b></font></b></font></b></h1>
                  </div>
                </td>
              </tr>
              <tr> 
                <td valign="top" width="66%"> 
                  <div align="center"> 
                    <div align="center"> 
                      <div align="center"> 
                        <div align="center"> 
                          <div align="center"> </div>
                          <div align="center"> 
                            <div align="center"> 
                              <div align="center"> 
                                <div align="center"> 
                                  <div align="center"> 
                                    <div align="center"> </div>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                        <div align="center"> </div>
                        <div align="center"> 
                          <div align="center"> </div>
                        </div>
                      </div>
                    </div>
                  </div>
                  <div align="center"></div>
                  <div align="center"> </div>
                  <div align="center"> </div>
                  <!-- #BeginLibraryItem "/Library/free-temps-navigation.lbi" -->
<div align="center"> <font face="Arial, Helvetica, sans-serif" size="2"><b> &gt;&gt; 
  [ <a href="http://www.afreewebtemplate.com/free-templates1.html">1</a> ] [ <a href="http://www.afreewebtemplate.com/free-templates2.html">2</a> 
  ] [ <a href="http://www.afreewebtemplate.com/free-templates3.html">3</a> ] [ <a href="http://www.afreewebtemplate.com/free-templates4.html">4</a> 
  ] [ <a href="http://www.afreewebtemplate.com/free-templates5.html">5</a> ] [ <a href="http://www.afreewebtemplate.com/free-templates6.html">6</a> 
  ] [ <a href="http://www.afreewebtemplate.com./free-templates7.html">7</a> ] [ <a href="http://www.afreewebtemplate.com/free-templates8.html">8</a> 
  ] [ <a href="http://www.afreewebtemplate.com/free-templates9.html">9</a> ] [ <a href="http://www.afreewebtemplate.com/free-templates10.html">10</a> 
  ] [ <a href="http://www.afreewebtemplate.com/free-templates11.html">11</a> ] [ <a href="http://www.afreewebtemplate.com/free-templates12.html">12</a> 
  ] [ <a href="http://www.afreewebtemplate.com./free-templates13.html">13</a> ] [ <a href="http://www.afreewebtemplate.com/free-templates14.html">14</a> 
  ] &lt;&lt; </b></font></div>
<!-- #EndLibraryItem --> 
                  <div align="center"><img src="../images/lines.gif" width="517" height="1"> 
                  </div>
                  <div align="center"> 
                    <div align="center"> 
                      <div align="center"> 
                        <div align="center"> 
                          <div align="center"><!-- #BeginEditable "content" --> 
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                              <tr> 
                                <td valign="top"> 
                                  <div align="center"> </div>
                                  <table width="100%" border="0" cellspacing="0" cellpadding="5">
                                    <tr valign="top"> 
                                      <td height="881"> 
                                        <h1 align="center"><font face="Arial, Helvetica, sans-serif" size="2"> 
                                          </font>The Three Principles Of HTML 
                                          Code Optimization</h1>
                                        <p align="left"><font face="Arial, Helvetica, sans-serif" size="2"><!-- #BeginLibraryItem "/Library/adsense-300x250.lbi" --> 
<script language="JavaScript" type="text/javascript">
<!--
ctxt_ad_partner = "1917901875";
ctxt_ad_section = "10687";
ctxt_ad_bg = "";
ctxt_ad_width = 336;
ctxt_ad_height = 280;
ctxt_ad_bc = "FFFFFF";
ctxt_ad_cc = "FFFFFF";
ctxt_ad_lc = "0000FF";
ctxt_ad_tc = "000000";
ctxt_ad_uc = "999999";
// -->
</script>
<script language="JavaScript" src="http://ypn-js.overture.com/partner/js/ypn.js">
</script><!-- #EndLibraryItem --></font> </p>
                                        <p>Just like spring cleaning a house, 
                                          the html code of your web pages should 
                                          get periodic cleaning as well. Over 
                                          time, as changes and updates are made 
                                          to a web page, the code can become littered 
                                          with unnecessary clutter, slowing down 
                                          page load times and hurting the efficiency 
                                          of your web page. Cluttered html can 
                                          also seriously impact your search engine 
                                          ranking. </p>
                                        <p>This is especially true if you are 
                                          using a WYSIWYG (What You See Is What 
                                          You Get) web design package such as 
                                          FrontPage or Dreamweaver. These programs 
                                          will speed up your web site creation, 
                                          but they are not that efficient at writing 
                                          clean html code. </p>
                                        <p>We will be focusing this discussion 
                                          on the actual html coding, ignoring 
                                          other programming languages that may 
                                          be used in a page such as JavaScript. 
                                          In the code examples I will be using 
                                          ( and ) characters instead of correct 
                                          html so that the code examples will 
                                          display properly in this newsletter. 
                                        </p>
                                        <p>Up until recently when coding a page 
                                          in HTML we would be using tags such 
                                          as the (font) tag and (p) paragraph 
                                          tags. Between these tags would be our 
                                          page content, text, images and links. 
                                          Each time a formatting change was made 
                                          on the page new tags were needed with 
                                          complete formatting for the new section. 
                                          More recently we have gained the ability 
                                          to use Cascading Style Sheets, allowing 
                                          us to write the formatting once and 
                                          then refer to that formatting several 
                                          times within a web page. </p>
                                        <p>In order to speed up page load times 
                                          we need to have fewer characters on 
                                          the page when viewed in an html editor. 
                                          Since we really do not want to remove 
                                          any of our visible content we need to 
                                          look to the html code. By cleaning up 
                                          this code we can remove characters, 
                                          thereby creating a smaller web page 
                                          that will load more quickly. </p>
                                        <p>Over time HTML has changed and we now 
                                          have many different ways to do the same 
                                          thing. An example would be the code 
                                          used to show a bold type face. In HTML 
                                          we have two main choices, the (strong) 
                                          tag and the (b) tag. As you can see 
                                          the (strong) tag uses 5 more characters 
                                          than the (b) tag, and if we consider 
                                          the closing tags as well we see that 
                                          using the (strong)(/strong) tag pair 
                                          uses 10 more characters than the cleaner 
                                          (b)(/b) tag pair. </p>
                                        <p>This is our First Principle of clean 
                                          HTML code: Use the simplest coding method 
                                          available. </p>
                                        <p>HTML has the ability of nesting code 
                                          within other code. For instance we could 
                                          have a line with three words where the 
                                          middle word was in bold. This could 
                                          be accomplished by changing the formatting 
                                          completely each time the visible formatting 
                                          changes. Consider this code: </p>
                                        <p>(font face=&#148;times&#148;)This(/font) 
                                          <br>
                                          (font face=&#148;times&#148;)(strong)BOLD(/strong)(/font) 
                                          <br>
                                          (font face=&#148;times&#148;)Word(/font) 
                                          <br>
                                          This takes up 90 characters. </p>
                                        <p>This is very poorly written html and 
                                          is what you occasionally will get when 
                                          using a WYSIWYG editor. Since the (font) 
                                          tags are repeating the same information 
                                          we can simply nest the (strong) tags 
                                          inside the (font) tags, and better yet 
                                          use the (b) tag instead of the (strong) 
                                          tag. This would give us this code (font 
                                          face=&#148;times)This (b)BOLD(/b) Word(/font), 
                                          taking up only 46 characters. </p>
                                        <p>This is our Second Principle of clean 
                                          HTML code: Use nested tags when possible. 
                                          Be aware that WYSIWYG editors will frequently 
                                          update formatting by adding layer after 
                                          layer of nested code. So while you are 
                                          cleaning up the code look for redundant 
                                          nested code placed there by your WYSIWYG 
                                          editing program. </p>
                                        <p>A big problem with using HTML tags 
                                          is that we need to repeat the tag coding 
                                          whenever we change the formatting. The 
                                          advent of CSS allows us a great advantage 
                                          in clean coding by allowing us to layout 
                                          the formatting once in a document, then 
                                          simply refer to it over and over again. 
                                        </p>
                                        <p>If we had six paragraphs in a page 
                                          that switch between two different types 
                                          of formatting, such as headings in Blue, 
                                          Bold, Ariel, size 4 and paragraph text 
                                          in Black, Times, size 2, using tags 
                                          we would need to list that complete 
                                          formatting each time we make a change. 
                                        </p>
                                        <p>(font face=&#148;Ariel&#148; color=&#148;blue&#148; 
                                          size=&#148;4&#148;)(b)Our heading(/b)(/font) 
                                          <br>
                                          (font face=&#148;Times color=&#148;black&#148; 
                                          size=&#148;2&#148;)Our paragraph(/font) 
                                          <br>
                                          (font face=&#148;Ariel&#148; color=&#148;blue&#148; 
                                          size=&#148;4&#148;)(b)Our next heading(/b)(/font) 
                                          <br>
                                          (font face=&#148;Times color=&#148;black&#148; 
                                          size=&#148;2&#148;)Our next paragraph(/font) 
                                        </p>
                                        <p>We would then repeat this for each 
                                          heading and paragraph, lots of html 
                                          code. </p>
                                        <p>With CSS we could create CSS Styles 
                                          for each formatting type, list the Styles 
                                          once in the Header of the page, and 
                                          then simply refer to the Style each 
                                          time we make a change. </p>
                                        <p>(head) <br>
                                          (style type=&quot;text/css&quot;) <br>
                                          (!-- <br>
                                          .style1 { <br>
                                          font-family: Arial, Helvetica, sans-serif; 
                                          <br>
                                          font-weight: bold; <br>
                                          font-size: 24px; <br>
                                          } <br>
                                          .style2 { <br>
                                          font-family: &quot;Times New Roman&quot;, 
                                          Times, serif; <br>
                                          font-size: 12px; <br>
                                          } <br>
                                          --) <br>
                                          (/style) <br>
                                          (/head) <br>
                                          (body) <br>
                                          (p class=&quot;style1&quot;)Heading(/p) 
                                          <br>
                                          (p class=&quot;style2&quot;)Paragraph 
                                          Text(/p) <br>
                                          (/body) </p>
                                        <p>Notice that the Styles are created 
                                          in the Head section of the page and 
                                          then simply referenced in the Body section. 
                                          As we add more formatting we would simply 
                                          continue to refer to the previously 
                                          created Styles. </p>
                                        <p>This is our Third Principle of Clean 
                                          HTML Code: Use CSS styles when ever 
                                          possible. CSS has several other benefits, 
                                          such as being able to place the CSS 
                                          styles in an external file, thereby 
                                          reducing the page size even more, and 
                                          the ability to quickly update formatting 
                                          site-wide by simply updating the external 
                                          CSS Style file. </p>
                                        <p>So with some simple cleaning of your 
                                          HTML code you can easily reduce the 
                                          file size and make a fast loading, lean 
                                          and mean web page. </p>
                                        <p>About the author:<br>
                                          George Peirson is a successful Entrepreneur 
                                          and Internet Trainer. He is the author 
                                          of over 30 multimedia based tutorial 
                                          training titles covering such topics 
                                          as Photoshop, Flash and Dreamweaver. 
                                          To see his training sets visit <a href="http://www.howtogurus.com" target="_blank">www.howtogurus.com</a> 
                                          Article copyright 2005 George Peirson</p>
                                        <p><font size="2" face="Arial, Helvetica, sans-serif"> 
                                          </font></p>
                                      </td>
                                    </tr>
                                  </table>
                                  <div align="left">&lt;&lt; <a href="index.html">Return 
                                    to Articles Home Page</a><font face="Arial, Helvetica, sans-serif" size="2"> 
                                    </font>&nbsp; &nbsp; </div>
                                </td>
                              </tr>
                            </table>
                            <script language="javascript">
function mailpage()
{
mail_str = "mailto:?subject=Check out this page called " + document.title;
mail_str += "&body=I thought you might be interested in this page called " + document.title;
mail_str += ". You can view it at, " + location.href.toString(); 
location.href = mail_str;
}
</script>
                            <!-- #EndEditable --></div>
                        </div>
                      </div>
                    </div>
                  </div>
                </td>
              </tr>
            </table>
            
          </td>
        </tr>
      </table>
      <div align="center"><b> <br>
        If you use our free web templates, please link back to us a <a href="http://www.afreewebtemplate.com">http://www.afreewebtemplate.com</a>.</b></div>
    </td>
    <td><img src="../images/shim.gif" width="1" height="393" border="0"></td>
  </tr>
  <tr valign="top"> <!-- row 8 --> 
    <td colspan="4"><img name="layout_r8_c1" src="../images/layout_r8_c1.gif" width="1000" height="13" border="0"></td>
    <td><img src="../images/shim.gif" width="1" height="13" border="0"></td>
  </tr>
</table>
<!-- #BeginLibraryItem "/Library/bottom.lbi" -->
<div align="center"><font size="1" face="Arial, Helvetica, sans-serif"><a href="../index.html"><font size="2">Home</font></a><font size="2"> 
  | <a href="../free-templates1.html">Free Web Templates</a> | <a href="../freegraphics">Free 
  Web Graphics</a> | <a href="../articles">Web Design Articles</a> | <a href="../resources.html">Resources</a><br>
  © 2002-2009 <a href="../index.html">A Free Web Template</a>. All Rights Reserved.</font></font><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif"> 
  </font></div>
<!-- #EndLibraryItem --> 
</body>
<!-- #EndTemplate --></html>

