Introduction To HTML

What is an HTML File?

  • HTML stands for Hyper Text Markup Language
  • An HTML file is a text file containing small markup tags
  • The markup tags tell the Web browser how to display the page
  • An HTML file must have an htm or html file extension
  • An HTML file can be created using a simple text editor

Do You Want to Try It?

If you are running Windows, start Notepad.

If you are on a Mac, start SimpleText.

In OSX start TextEdit and change the following preferences: Open the the "Format" menu and select "Plain text" instead of "Rich text". Then open the "Preferences" window under the "Text Edit" menu and select "Ignore rich text commands in HTML files". Your HTML code will probably not work if you do not change the preferences above!

Type in the following text:



Title of page


This is my first homepage. This text is bold

Save the file as "mypage.htm".

Start your Internet browser. Select "Open" (or "Open Page") in the File menu of your browser. A dialog box will appear. Select "Browse" (or "Choose File") and locate the HTML file you just created - "mypage.htm" - select it and click "Open". Now you should see an address in the dialog box, for example "C:\MyDocuments\mypage.htm". Click OK, and the browser will display the page.


Example Explained

The first tag in your HTML document is . This tag tells your browser that this is the start of an HTML document. The last tag in your document is . This tag tells your browser that this is the end of the HTML document.

The text between the tag and the tag is header information. Header information is not displayed in the browser window.

The text between the tags is the title of your document. The title is displayed in your browser's caption.</p> <p>The text between the <body> tags is the text that will be displayed in your browser.</p> <p>The text between the <b> and </b> tags will be displayed in a bold font.</p> <hr /> <h2>HTM or HTML Extension?</h2> <p>When you save an HTML file, you can use either the .htm or the .html extension. We have used .htm in our examples. It might be a bad habit inherited from the past when some of the commonly used software only allowed three letter extensions.</p> <p>With newer software we think it will be perfectly safe to use .html.</p> <hr /> <h2>Note on HTML Editors:</h2> <p>You can easily edit HTML files using a WYSIWYG (what you see is what you get) editor like FrontPage or Dreamweaver, instead of writing your markup tags in a plain text file.</p> <p>However, if you want to be a skillful Web developer, we strongly recommend that you use a plain text editor to learn your primer HTML.</p> <hr /> <h2>Frequently Asked Questions</h2> <p><b>Q: After I have edited an HTML file, I cannot view the result in my browser. Why?<br />A: </b>Make sure that you have saved the file with a proper name and extension like "c:\mypage.htm". Also make sure that you use the same name when you open the file in your browser. </p> <p><b>Q: I have edited an HTML file, but the changes don't show in the browser. Why?<br />A: </b>A browser caches pages so it doesn't have to read the same page twice. When you have modified a page, the browser doesn't know that. Use the browser's refresh/reload button to force the browser to reload the page. </p> <p><b>Q: What browser should I use?<br />A: </b>You can do all the training with all of the well-known browsers, like Internet Explorer, Firefox, Netscape, or Opera. However, some of the examples in our advanced classes require the latest versions of the browsers.</p> <p><b>Q: Does my computer have to run Windows? What about a Mac?<br />A: </b>You can do all your training on a non-Windows computer like a Mac.</p> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'><span class='post-icons'> <span class='item-control blog-admin pid-1833975000'> <a href='https://www.blogger.com/post-edit.g?blogID=786837436972712872&postID=6519835947588055720&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> </div> <div class='post-footer-line post-footer-line-2'><span class='post-labels'> Exercise <a href='http://onlinehtml.blogspot.com/search/label/Introduction%20To%20HTML' rel='tag'>Introduction To HTML</a> </span> </div> <div class='post-footer-line post-footer-line-3'></div> </div> </div> <div class='comments' id='comments'> <a name='comments'></a> </div> </div> </div></div> </div> <div class='blog-pager' id='blog-pager'> <span id='blog-pager-newer-link'> <a class='blog-pager-newer-link' href='http://onlinehtml.blogspot.com/2008/01/html-elements.html' id='Blog1_blog-pager-newer-link' title='Newer Post'>Newer Post</a> </span> <span id='blog-pager-older-link'> <a class='blog-pager-older-link' href='http://onlinehtml.blogspot.com/2008/01/home.html' id='Blog1_blog-pager-older-link' title='Older Post'>Older Post</a> </span> <a class='home-link' href='http://onlinehtml.blogspot.com/'>Home</a> </div> <div class='clear'></div> <div class='post-feeds'> </div> </div><div class='widget HTML' data-version='1' id='HTML7'> <div class='widget-content'> <div><script type="text/javascript">var addthis_pub="nomigobo";</script> <a onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" href="http://www.addthis.com/bookmark.php" onclick="return addthis_sendto()"><img border="0" width="83" alt="" style="border:0" src="http://s7.addthis.com/static/btn/sm-share-en.gif" height="16"/></a><script src="http://s7.addthis.com/js/152/addthis_widget.js" type="text/javascript"></script></div> </div> <div class='clear'></div> </div><div class='widget HTML' data-version='1' id='HTML2'> <h2 class='title'>mixx it</h2> <div class='widget-content'> <a href="http://www.mixx.com/" onclick="window.location='http://www.mixx.com/submit?page_url='+window.location; return false;"> <img border="0" alt="Add to Mixx!" src="http://www.mixx.com/images/buttons/mixx-button5.png"/> </a> </div> <div class='clear'></div> </div></div> </div> <div id='ads-wrapper'> <div class='sidebar section' id='ads'><div class='widget AdSense' data-version='1' id='AdSense3'> <div class='widget-content'> <script type="text/javascript"><!-- google_ad_client="pub-3758486422209903"; google_ad_host="pub-1556223355139109"; google_ad_host_channel="00000"; google_ad_width=160; google_ad_height=600; google_ad_format="160x600_as"; google_ad_type="text_image"; google_color_border="FFFFFF"; google_color_bg="FFFFFF"; google_color_link="6699CC"; google_color_url="6699CC"; google_color_text="6699CC"; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> <div class='clear'></div> </div> </div><div class='widget HTML' data-version='1' id='HTML5'> <div class='widget-content'> <!-- Search Google --> <center> <form action="http://www.google.com/custom" target="_top" method="get"> <table bgcolor="#ffffff"> <tr><td nowrap="nowrap" valign="top" height="32" align="left"> <a href="http://www.google.com/"> <img border="0" alt="Google" src="http://www.google.com/logos/Logo_25wht.gif" align="middle"/></a> <br/> <label for="sbi" style="display: none">Enter your search terms</label> <input maxlength="255" id="sbi" value="" name="q" size="20" type="text"/> </td></tr> <tr><td valign="top" align="left"> <label for="sbb" style="display: none">Submit search form</label> <input id="sbb" value="Search" name="sa" type="submit"/> <input value="pub-3758486422209903" name="client" type="hidden"/> <input value="1" name="forid" type="hidden"/> <input value="ISO-8859-1" name="ie" type="hidden"/> <input value="ISO-8859-1" name="oe" type="hidden"/> <input value="GALT:#008000;GL:1;DIV:#FFFFFF;VLC:663399;AH:center;BGC:FFFFFF;LBGC:FFFFFF;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1" name="cof" type="hidden"/> <input value="en" name="hl" type="hidden"/> </td></tr></table> </form> </center> <!-- Search Google --> </div> <div class='clear'></div> </div><div class='widget HTML' data-version='1' id='HTML1'> <div class='widget-content'> <a href="http://www.url-submitter.com/">URL Submitter</a> - Submit your URL to Search engines and Directories for FREE! </div> <div class='clear'></div> </div><div class='widget HTML' data-version='1' id='HTML3'> <h2 class='title'>FEEDJIT Live Traffic Feed</h2> <div class='widget-content'> <script src="http://feedjit.com/serve/?bc=FFFFFF&tc=494949&brd1=336699&lnk=494949&hc=336699&ww=160" type="text/javascript"></script><noscript><a href="http://feedjit.com/">Feedjit Live Blog Stats</a></noscript> </div> <div class='clear'></div> </div><div class='widget AdSense' data-version='1' id='AdSense5'> <div class='widget-content'> <script type="text/javascript"><!-- google_ad_client="pub-3758486422209903"; google_ad_host="pub-1556223355139109"; google_ad_host_channel="00000"; google_ad_width=200; google_ad_height=90; google_ad_format="200x90_0ads_al_s"; google_color_border="FFFFFF"; google_color_bg="FFFFFF"; google_color_link="336699"; google_color_url="336699"; google_color_text="336699"; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> <div class='clear'></div> </div> </div></div> </div> <!-- spacer for skins that want sidebar and main to be the same height --> <div class='clear'> </div> </div> <!-- end content-wrapper --> </div> <div id='footer-wrapper'> <div class='footer section' id='footer'><div class='widget AdSense' data-version='1' id='AdSense2'> <div class='widget-content'> <script type="text/javascript"><!-- google_ad_client="pub-3758486422209903"; google_ad_host="pub-1556223355139109"; google_ad_host_channel="00000"; google_ad_width=728; google_ad_height=15; google_ad_format="728x15_0ads_al_s"; google_color_border="FFFFFF"; google_color_bg="FFFFFF"; google_color_link="336699"; google_color_url="336699"; google_color_text="336699"; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> <div class='clear'></div> </div> </div></div> </div> </div> </div> <!-- end outer-wrapper --> <script type="text/javascript" src="https://www.blogger.com/static/v1/widgets/1601900224-widgets.js"></script> <script type='text/javascript'> window['__wavt'] = 'AOuZoY5Npzs3c_Xkt_YKm8R4K3_uySlmmg:1761139401798';_WidgetManager._Init('//www.blogger.com/rearrange?blogID\x3d786837436972712872','//onlinehtml.blogspot.com/2008/01/introduction-to-html.html','786837436972712872'); _WidgetManager._SetDataContext([{'name': 'blog', 'data': {'blogId': '786837436972712872', 'title': 'Learn Online HTML Free', 'url': 'http://onlinehtml.blogspot.com/2008/01/introduction-to-html.html', 'canonicalUrl': 'http://onlinehtml.blogspot.com/2008/01/introduction-to-html.html', 'homepageUrl': 'http://onlinehtml.blogspot.com/', 'searchUrl': 'http://onlinehtml.blogspot.com/search', 'canonicalHomepageUrl': 'http://onlinehtml.blogspot.com/', 'blogspotFaviconUrl': 'http://onlinehtml.blogspot.com/favicon.ico', 'bloggerUrl': 'https://www.blogger.com', 'hasCustomDomain': false, 'httpsEnabled': true, 'enabledCommentProfileImages': true, 'gPlusViewType': 'FILTERED_POSTMOD', 'adultContent': false, 'analyticsAccountNumber': '', 'encoding': 'UTF-8', 'locale': 'en-US', 'localeUnderscoreDelimited': 'en', 'languageDirection': 'ltr', 'isPrivate': false, 'isMobile': false, 'isMobileRequest': false, 'mobileClass': '', 'isPrivateBlog': false, 'isDynamicViewsAvailable': true, 'feedLinks': '\x3clink rel\x3d\x22alternate\x22 type\x3d\x22application/atom+xml\x22 title\x3d\x22Learn Online HTML Free - Atom\x22 href\x3d\x22http://onlinehtml.blogspot.com/feeds/posts/default\x22 /\x3e\n\x3clink rel\x3d\x22alternate\x22 type\x3d\x22application/rss+xml\x22 title\x3d\x22Learn Online HTML Free - RSS\x22 href\x3d\x22http://onlinehtml.blogspot.com/feeds/posts/default?alt\x3drss\x22 /\x3e\n\x3clink rel\x3d\x22service.post\x22 type\x3d\x22application/atom+xml\x22 title\x3d\x22Learn Online HTML Free - Atom\x22 href\x3d\x22https://www.blogger.com/feeds/786837436972712872/posts/default\x22 /\x3e\n\n\x3clink rel\x3d\x22alternate\x22 type\x3d\x22application/atom+xml\x22 title\x3d\x22Learn Online HTML Free - Atom\x22 href\x3d\x22http://onlinehtml.blogspot.com/feeds/6519835947588055720/comments/default\x22 /\x3e\n', 'meTag': '', 'adsenseClientId': 'ca-pub-3758486422209903', 'adsenseHostId': 'ca-host-pub-1556223355139109', 'adsenseHasAds': true, 'adsenseAutoAds': false, 'boqCommentIframeForm': true, 'loginRedirectParam': '', 'isGoogleEverywhereLinkTooltipEnabled': true, 'view': '', 'dynamicViewsCommentsSrc': '//www.blogblog.com/dynamicviews/4224c15c4e7c9321/js/comments.js', 'dynamicViewsScriptSrc': '//www.blogblog.com/dynamicviews/d324bc10ebcc3822', 'plusOneApiSrc': 'https://apis.google.com/js/platform.js', 'disableGComments': true, 'interstitialAccepted': false, 'sharing': {'platforms': [{'name': 'Get link', 'key': 'link', 'shareMessage': 'Get link', 'target': ''}, {'name': 'Facebook', 'key': 'facebook', 'shareMessage': 'Share to Facebook', 'target': 'facebook'}, {'name': 'BlogThis!', 'key': 'blogThis', 'shareMessage': 'BlogThis!', 'target': 'blog'}, {'name': 'X', 'key': 'twitter', 'shareMessage': 'Share to X', 'target': 'twitter'}, {'name': 'Pinterest', 'key': 'pinterest', 'shareMessage': 'Share to Pinterest', 'target': 'pinterest'}, {'name': 'Email', 'key': 'email', 'shareMessage': 'Email', 'target': 'email'}], 'disableGooglePlus': true, 'googlePlusShareButtonWidth': 0, 'googlePlusBootstrap': '\x3cscript type\x3d\x22text/javascript\x22\x3ewindow.___gcfg \x3d {\x27lang\x27: \x27en\x27};\x3c/script\x3e'}, 'hasCustomJumpLinkMessage': false, 'jumpLinkMessage': 'Read more', 'pageType': 'item', 'postId': '6519835947588055720', 'pageName': 'Introduction To HTML', 'pageTitle': 'Learn Online HTML Free: Introduction To HTML'}}, {'name': 'features', 'data': {}}, {'name': 'messages', 'data': {'edit': 'Edit', 'linkCopiedToClipboard': 'Link copied to clipboard!', 'ok': 'Ok', 'postLink': 'Post Link'}}, {'name': 'template', 'data': {'name': 'custom', 'localizedName': 'Custom', 'isResponsive': false, 'isAlternateRendering': false, 'isCustom': true}}, {'name': 'view', 'data': {'classic': {'name': 'classic', 'url': '?view\x3dclassic'}, 'flipcard': {'name': 'flipcard', 'url': '?view\x3dflipcard'}, 'magazine': {'name': 'magazine', 'url': '?view\x3dmagazine'}, 'mosaic': {'name': 'mosaic', 'url': '?view\x3dmosaic'}, 'sidebar': {'name': 'sidebar', 'url': '?view\x3dsidebar'}, 'snapshot': {'name': 'snapshot', 'url': '?view\x3dsnapshot'}, 'timeslide': {'name': 'timeslide', 'url': '?view\x3dtimeslide'}, 'isMobile': false, 'title': 'Introduction To HTML', 'description': 'What is an HTML File? HTML stands for H yper T ext M arkup L anguage An HTML file is a text file containing small markup tags The markup ...', 'url': 'http://onlinehtml.blogspot.com/2008/01/introduction-to-html.html', 'type': 'item', 'isSingleItem': true, 'isMultipleItems': false, 'isError': false, 'isPage': false, 'isPost': true, 'isHomepage': false, 'isArchive': false, 'isLabelSearch': false, 'postId': 6519835947588055720}}]); _WidgetManager._RegisterWidget('_NavbarView', new _WidgetInfo('Navbar1', 'navbar', document.getElementById('Navbar1'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_HeaderView', new _WidgetInfo('Header1', 'header', document.getElementById('Header1'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_HTMLView', new _WidgetInfo('HTML6', 'sidebar', document.getElementById('HTML6'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_HTMLView', new _WidgetInfo('HTML4', 'sidebar', document.getElementById('HTML4'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_AdSenseView', new _WidgetInfo('AdSense1', 'sidebar', document.getElementById('AdSense1'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_AdSenseView', new _WidgetInfo('AdSense4', 'main', document.getElementById('AdSense4'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_BlogView', new _WidgetInfo('Blog1', 'main', document.getElementById('Blog1'), {'cmtInteractionsEnabled': false, 'lightboxEnabled': true, 'lightboxModuleUrl': 'https://www.blogger.com/static/v1/jsbin/6096503-lbx.js', 'lightboxCssUrl': 'https://www.blogger.com/static/v1/v-css/828616780-lightbox_bundle.css'}, 'displayModeFull')); _WidgetManager._RegisterWidget('_HTMLView', new _WidgetInfo('HTML7', 'main', document.getElementById('HTML7'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_HTMLView', new _WidgetInfo('HTML2', 'main', document.getElementById('HTML2'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_AdSenseView', new _WidgetInfo('AdSense3', 'ads', document.getElementById('AdSense3'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_HTMLView', new _WidgetInfo('HTML5', 'ads', document.getElementById('HTML5'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_HTMLView', new _WidgetInfo('HTML1', 'ads', document.getElementById('HTML1'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_HTMLView', new _WidgetInfo('HTML3', 'ads', document.getElementById('HTML3'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_AdSenseView', new _WidgetInfo('AdSense5', 'ads', document.getElementById('AdSense5'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_AdSenseView', new _WidgetInfo('AdSense2', 'footer', document.getElementById('AdSense2'), {}, 'displayModeFull')); </script> </body> </html>