<html><!-- #BeginTemplate "/Templates/coolblue-inside.dwt" -->
<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="2006/12/08">
<META NAME="robots" content="index,follow">
<META NAME="revisit-after" content="10_days">
<!-- #EndEditable --> 
<LINK REL=stylesheet HREF="http://www.webmajestic.com/mystyle.css" TYPE="text/css">
</head>
<body bgcolor="#79849A" topmargin="0">
<!-- Kontera ContentLink(TM);--> 
<script type='text/javascript'>
var dc_AdLinkColor = 'green' ;
var dc_UnitID = 14 ;
var dc_PublisherID = 11118;
var dc_adprod = 'ADL' ;
</script>
<script type='text/javascript' 
src='http://kona.kontera.com/javascript/lib/KonaLibInline.js'>
</script>
<!-- Kontera ContentLink(TM) --> 
<table border="0" cellpadding="0" cellspacing="0" width="750" align="center">
  <tr> <!-- Shim row, height 1. --> 
    <td><img src="../images/shim.gif" width="750" height="1" border="0"></td>
    <td><img src="../images/shim.gif" width="1" height="1" border="0"></td>
  </tr>
  <tr valign="top"> 
    <td bgcolor="#FFFFFF"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="10">
        <tr> 
          <td width="76%" valign="top"> 
            <div align="center"> 
              <table border="0" cellpadding="0" cellspacing="0" width="750">
                <!-- fwtable fwsrc="home2.png" fwbase="index.gif" --> 
                <tr> <!-- Shim row, height 1. --> 
                  <td><img src="../images/shim.gif" width="217" height="1" border="0"></td>
                  <td><img src="../images/shim.gif" width="533" 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 rowspan="2"><img name="index_r1_c1" src="../images/index_r1_c1.gif" width="217" height="263" border="0" usemap="#hoover_index_r1_c1MapMap"><map name="hoover_index_r1_c1MapMap"><area shape="rect" coords="8,9,198,245" href="../index.html" alt="Home" title="Home"></map></td>
                  <td><img name="index_r1_c2" src="../images/index_r1_c2.gif" width="533" height="230" border="0" usemap="#hoover_index_r1_c1Map"><map name="hoover_index_r1_c1Map"><area shape="rect" coords="447,176,531,213" href="http://www.webmajestic.com/contact.html" alt="Contact Webmajestic" title="Contact Webmajestic"><area shape="rect" coords="349,175,444,213" href="http://www.webmajestic.com/resources.html" alt="Resources" title="Resources"><area shape="rect" coords="3,175,79,214" href="http://www.webmajestic.com/web_lessons.html" alt="Web Design Lessons" title="Web Design Lessons"><area shape="rect" coords="83,176,169,214" href="http://www.webmajestic.com/templates" alt="Web Design Templates" title="Web Design Templates"><area shape="rect" coords="170,177,262,213" href="http://www.webmajestic.com/articles" alt="Web Design Articles" title="Web Design Articles"><area shape="rect" coords="263,177,349,212" href="http://www.webmajestic.com/graphics" alt="Free Web Graphics" title="Free Web Graphics"><area shape="rect" coords="4,4,527,165" href="../index.html" alt="Home" title="Home"></map></td>
                  <td><img src="../images/shim.gif" width="1" height="230" border="0"></td>
                </tr>
                <tr valign="top"><!-- row 2 --> 
                  <td background="../images/index_r2_c2.gif" valign="middle">
                    <div align="right"><!-- Google CSE Search Box Begins --> 
                      <form id="searchbox_001927420258398297637:nplqsaxspt4" action="http://www.webmajestic.com/results.html">
                        <input type="hidden" name="cx" value="001927420258398297637:nplqsaxspt4" />
                        <input name="q" type="text" size="30" value=" " />
                        <input style="background:CCCCCC; border-width:1px" type="submit" name="sa" value="Search" />
                        <input type="hidden" name="cof" value="FORID:11" />
                      </form>
                      <script type="text/javascript" src="http://google.com/coop/cse/brand?form=searchbox_001927420258398297637%3Anplqsaxspt4"></script>
                      <!-- Google CSE Search Box Ends --></div>
                  </td>
                  <td><img src="../images/shim.gif" width="1" height="33" border="0"></td>
                </tr>
              </table>
              
              <script type="text/javascript"><!--
google_ad_client = "pub-3142337522589164";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
//2007-09-30: webmajestic
google_ad_channel = "6999496151";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "0033FF";
google_color_text = "000000";
google_color_url = "0033FF";
//-->
</script>
              <script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
            </div>
            <!-- #BeginEditable "content" --> 
            <div align="center"></div>
            <table width="100%" border="0" cellspacing="0" cellpadding="5">
              <tr valign="top"> 
                <td> 
                  <h1 align="center">The Three Principles Of HTML Code Optimization 
                    by: George Peirson </h1>
                  <font face="Arial, Helvetica, sans-serif" size="2"> </font> 
                  <table width="100%" border="0" cellspacing="0" cellpadding="2">
                    <tr valign="top"> 
                      <td><font face="Arial, Helvetica, sans-serif" size="2"> 
                        <script type="text/javascript"><!--
google_ad_client = "pub-3142337522589164";
google_ad_width = 336;
google_ad_height = 280;
google_ad_format = "336x280_as";
google_ad_type = "text";
//2006-12-07: webmajestic
google_ad_channel = "6999496151";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "0033FF";
google_color_text = "000000";
google_color_url = "0033FF";
//--></script>
                        <script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
                        </font> 
                        <table width="236" border="1" cellspacing="0" cellpadding="5" bordercolor="#6666FF">
                          <tr> 
                            <td> 
                              <p><b>Related Articles</b></p>
                              <p><a href="webdesign-business.html">Web Design 
                                Business - 5 Surefire Ways To Fail</a></p>
                              <p><a href="web-design-work.html">How Not To Get 
                                Web Design Work</a></p>
                              <p><a href="website-copy.html">Your Website Copy 
                                Could be Letting You Down</a></p>
                            </td>
                          </tr>
                        </table>
                        <p>&lt;&lt; <a href="index.html">Return to Articles Home 
                          Page</a><font face="Arial, Helvetica, sans-serif" size="2"> 
                          </font></p>
                      <font face="Arial, Helvetica, sans-serif" size="2"> </font></td>
                      <td> 
                        <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>
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
            <!-- #EndEditable --> 
            <div align="center"> </div>
            <div align="right"></div>
          </td>
        </tr>
      </table>
    </td>
    <td>&nbsp;</td>
  </tr>
  <tr valign="top"><!-- row 3 --> 
    <td background="../images/hoover_index_r3_c1.gif" valign="middle"> 
      <div align="center"><a href="http://www.webmajestic.com">Home</a> | <a href="http://www.webmajestic.com/webguide.html">Tutorials</a> 
        | <a href="http://www.webmajestic.com/userpages">Free Site Builder</a> 
        | <a href="http://www.webmajestic.com/templates">Templates</a> | <a href="http://www.webmajestic.com/articles">Articles</a> 
        | <a href="http://www.webmajestic.com/graphics">Free Web Graphics</a> 
        | <a href="http://www.webmajestic.com/awardsprogram.html"> </a> <a href="http://www.webmajestic.com/resources.html">Web 
        Resources</a> | <a href="http://www.webmajestic.com/links.html">Links</a> 
        | <a href="http://www.webmajestic.com/privacy.html">Privacy</a> | <a href="http://www.webmajestic.com/contact.html">Contact</a></div>
    </td>
    <td><img src="../images/shim.gif" width="1" height="34" border="0"></td>
  </tr>
</table>
<div align="center"><font color="#CC6600"><font color="#FFFFFF"> © 2000-2008 <a href="http://www.webmajestic.com">Webmajestic.com</a>. 
  All Rights Reserved</font></font><font color="#FFFFFF">.</font> </div>
</body>

<!-- #EndTemplate --></html>