Tuesday, February 5, 2008

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.<br /><br />The text between the <body> tags is the text that will be displayed in your browser.<br /><br />The text between the <b> and </b> tags will be displayed in a bold font.<br />HTM or HTML Extension?<br /><br />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.<br /><br />With newer software we think it will be perfectly safe to use .html.<br />Note on HTML Editors:<br /><br />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.<br /><br />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.<br />Frequently Asked Questions<br /><br />Q: After I have edited an HTML file, I cannot view the result in my browser. Why?<br />A: 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.<br /><br />Q: I have edited an HTML file, but the changes don't show in the browser. Why?<br />A: 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.<br /><br />Q: What browser should I use?<br />A: 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.<br /><br />Q: Does my computer have to run Windows? What about a Mac?<br />A: You can do all your training on a non-Windows computer like a Mac. <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> Posted by <span class='fn' itemprop='author' itemscope='itemscope' itemtype='http://schema.org/Person'> <meta content='https://www.blogger.com/profile/10013322272418037218' itemprop='url'/> <a class='g-profile' href='https://www.blogger.com/profile/10013322272418037218' rel='author' title='author profile'> <span itemprop='name'>Unknown</span> </a> </span> </span> <span class='post-timestamp'> at <meta content='http://htmlbasictutorials.blogspot.com/2008/02/introduction-to-html_05.html' itemprop='url'/> <a class='timestamp-link' href='https://htmlbasictutorials.blogspot.com/2008/02/introduction-to-html_05.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2008-02-05T11:29:00-08:00'>11:29 AM</abbr></a> </span> <span class='post-comment-link'> </span> <span class='post-icons'> <span class='item-control blog-admin pid-1367346565'> <a href='https://www.blogger.com/post-edit.g?blogID=8134209472129637542&postID=3238235749269231475&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 class='post-share-buttons goog-inline-block'> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> <div class='comments' id='comments'> <a name='comments'></a> <h4>No comments:</h4> <div id='Blog1_comments-block-wrapper'> <dl class='avatar-comment-indent' id='comments-block'> </dl> </div> <p class='comment-footer'> <a href='https://www.blogger.com/comment/fullpage/post/8134209472129637542/3238235749269231475' onclick=''>Post a Comment</a> </p> </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='https://htmlbasictutorials.blogspot.com/2008/02/html-tutorial_05.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='https://htmlbasictutorials.blogspot.com/2008/02/html-elements.html' id='Blog1_blog-pager-older-link' title='Older Post'>Older Post</a> </span> <a class='home-link' href='https://htmlbasictutorials.blogspot.com/'>Home</a> </div> <div class='clear'></div> <div class='post-feeds'> <div class='feed-links'> Subscribe to: <a class='feed-link' href='https://htmlbasictutorials.blogspot.com/feeds/3238235749269231475/comments/default' target='_blank' type='application/atom+xml'>Post Comments (Atom)</a> </div> </div> </div></div> </div> <div id='sidebar-wrapper'> <div class='sidebar section' id='sidebar'><div class='widget AdSense' data-version='1' id='AdSense2'> <div class='widget-content'> <script type="text/javascript"><!-- google_ad_client="pub-4459060014368985"; google_ad_host="pub-1556223355139109"; google_ad_host_channel="00000"; google_ad_width=234; google_ad_height=60; google_ad_format="234x60_as"; google_ad_type="text"; google_color_border="FFFFFF"; google_color_bg="FFFFFF"; google_color_link="669922"; google_color_url="555544"; google_color_text="555544"; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> <div class='clear'></div> </div> </div><div class='widget BlogArchive' data-version='1' id='BlogArchive1'> <h2>Blog Archive</h2> <div class='widget-content'> <div id='ArchiveList'> <div id='BlogArchive1_ArchiveList'> <ul class='hierarchy'> <li class='archivedate expanded'> <a class='toggle' href='javascript:void(0)'> <span class='zippy toggle-open'> ▼  </span> </a> <a class='post-count-link' href='https://htmlbasictutorials.blogspot.com/2008/'> 2008 </a> <span class='post-count' dir='ltr'>(18)</span> <ul class='hierarchy'> <li class='archivedate expanded'> <a class='toggle' href='javascript:void(0)'> <span class='zippy toggle-open'> ▼  </span> </a> <a class='post-count-link' href='https://htmlbasictutorials.blogspot.com/2008/02/'> February </a> <span class='post-count' dir='ltr'>(18)</span> <ul class='posts'> <li><a href='https://htmlbasictutorials.blogspot.com/2008/02/html-tutorial_05.html'>HTML Tutorial</a></li> <li><a href='https://htmlbasictutorials.blogspot.com/2008/02/introduction-to-html_05.html'>Introduction to HTML</a></li> <li><a href='https://htmlbasictutorials.blogspot.com/2008/02/html-elements.html'>HTML Elements</a></li> <li><a href='https://htmlbasictutorials.blogspot.com/2008/02/basic-html-tags.html'>Basic HTML Tags</a></li> <li><a href='https://htmlbasictutorials.blogspot.com/2008/02/html-attributes.html'>HTML Attributes</a></li> <li><a href='https://htmlbasictutorials.blogspot.com/2008/02/html-text-formatting.html'>HTML Text Formatting</a></li> <li><a href='https://htmlbasictutorials.blogspot.com/2008/02/html-character-entities.html'>HTML Character Entities</a></li> <li><a href='https://htmlbasictutorials.blogspot.com/2008/02/html-links.html'>HTML Links</a></li> <li><a href='https://htmlbasictutorials.blogspot.com/2008/02/html-frames.html'>HTML Frames</a></li> <li><a href='https://htmlbasictutorials.blogspot.com/2008/02/html-tables.html'>HTML Tables</a></li> <li><a href='https://htmlbasictutorials.blogspot.com/2008/02/html-lists.html'>HTML Lists</a></li> <li><a href='https://htmlbasictutorials.blogspot.com/2008/02/html-forms-and-input.html'>HTML Forms and Input</a></li> <li><a href='https://htmlbasictutorials.blogspot.com/2008/02/html-images.html'>HTML Images</a></li> <li><a href='https://htmlbasictutorials.blogspot.com/2008/02/html-backgrounds.html'>HTML Backgrounds</a></li> <li><a href='https://htmlbasictutorials.blogspot.com/2008/02/html-colors.html'>HTML Colors</a></li> <li><a href='https://htmlbasictutorials.blogspot.com/2008/02/html-color-values.html'>HTML Color Values</a></li> <li><a href='https://htmlbasictutorials.blogspot.com/2008/02/html-color-names.html'>HTML Color Names</a></li> <li><a href='https://htmlbasictutorials.blogspot.com/2008/02/ready-to-publish-your-work.html'>Ready to Publish Your Work?</a></li> </ul> </li> </ul> </li> </ul> </div> </div> <div class='clear'></div> </div> </div><div class='widget Profile' data-version='1' id='Profile1'> <h2>About Me</h2> <div class='widget-content'> <dl class='profile-datablock'> <dt class='profile-data'> <a class='profile-name-link g-profile' href='https://www.blogger.com/profile/10013322272418037218' rel='author' style='background-image: url(//www.blogger.com/img/logo-16.png);'> Unknown </a> </dt> </dl> <a class='profile-link' href='https://www.blogger.com/profile/10013322272418037218' rel='author'>View my complete profile</a> <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 id='footer-wrapper'> <div class='footer section' id='footer'><div class='widget AdSense' data-version='1' id='AdSense1'> <div class='widget-content'> <script type="text/javascript"><!-- google_ad_client="pub-4459060014368985"; google_ad_host="pub-1556223355139109"; google_ad_host_channel="00000"; google_ad_width=468; google_ad_height=60; google_ad_format="468x60_as"; google_ad_type="text"; google_color_border="FFFFFF"; google_color_bg="FFFFFF"; google_color_link="669922"; google_color_url="555544"; google_color_text="555544"; //--></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/654365252-widgets.js"></script> <script type='text/javascript'> window['__wavt'] = 'AAVkm1syokpXYhJo_uyoXD3Ita1l:1778945033183';_WidgetManager._Init('//www.blogger.com/rearrange?blogID\x3d8134209472129637542','//htmlbasictutorials.blogspot.com/2008/02/introduction-to-html_05.html','8134209472129637542'); _WidgetManager._SetDataContext([{'name': 'blog', 'data': {'blogId': '8134209472129637542', 'title': 'HTML tutorials', 'url': 'https://htmlbasictutorials.blogspot.com/2008/02/introduction-to-html_05.html', 'canonicalUrl': 'http://htmlbasictutorials.blogspot.com/2008/02/introduction-to-html_05.html', 'homepageUrl': 'https://htmlbasictutorials.blogspot.com/', 'searchUrl': 'https://htmlbasictutorials.blogspot.com/search', 'canonicalHomepageUrl': 'http://htmlbasictutorials.blogspot.com/', 'blogspotFaviconUrl': 'https://htmlbasictutorials.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\x22HTML tutorials - Atom\x22 href\x3d\x22https://htmlbasictutorials.blogspot.com/feeds/posts/default\x22 /\x3e\n\x3clink rel\x3d\x22alternate\x22 type\x3d\x22application/rss+xml\x22 title\x3d\x22HTML tutorials - RSS\x22 href\x3d\x22https://htmlbasictutorials.blogspot.com/feeds/posts/default?alt\x3drss\x22 /\x3e\n\x3clink rel\x3d\x22service.post\x22 type\x3d\x22application/atom+xml\x22 title\x3d\x22HTML tutorials - Atom\x22 href\x3d\x22https://www.blogger.com/feeds/8134209472129637542/posts/default\x22 /\x3e\n\n\x3clink rel\x3d\x22alternate\x22 type\x3d\x22application/atom+xml\x22 title\x3d\x22HTML tutorials - Atom\x22 href\x3d\x22https://htmlbasictutorials.blogspot.com/feeds/3238235749269231475/comments/default\x22 /\x3e\n', 'meTag': '', 'adsenseClientId': 'ca-pub-4459060014368985', 'adsenseHostId': 'ca-host-pub-1556223355139109', 'adsenseHasAds': true, 'adsenseAutoAds': false, 'boqCommentIframeForm': true, 'loginRedirectParam': '', 'view': '', 'dynamicViewsCommentsSrc': '//www.blogblog.com/dynamicviews/4224c15c4e7c9321/js/comments.js', 'dynamicViewsScriptSrc': '//www.blogblog.com/dynamicviews/66f339c43d4ec606', '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': '3238235749269231475', 'pageName': 'Introduction to HTML', 'pageTitle': 'HTML tutorials: Introduction to HTML'}}, {'name': 'features', 'data': {}}, {'name': 'messages', 'data': {'edit': 'Edit', 'linkCopiedToClipboard': 'Link copied to clipboard!', 'ok': 'Ok', 'postLink': 'Post Link'}}, {'name': 'template', 'data': {'isResponsive': false, 'isAlternateRendering': false, 'isCustom': false}}, {'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 Hyper Text Markup Language * An HTML file is a text file containing small markup tags * ...', 'url': 'https://htmlbasictutorials.blogspot.com/2008/02/introduction-to-html_05.html', 'type': 'item', 'isSingleItem': true, 'isMultipleItems': false, 'isError': false, 'isPage': false, 'isPost': true, 'isHomepage': false, 'isArchive': false, 'isLabelSearch': false, 'postId': 3238235749269231475}}]); _WidgetManager._RegisterWidget('_NavbarView', new _WidgetInfo('Navbar1', 'navbar', document.getElementById('Navbar1'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_HeaderView', new _WidgetInfo('Header1', 'header', document.getElementById('Header1'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_AdSenseView', new _WidgetInfo('AdSense3', 'main', document.getElementById('AdSense3'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_BlogView', new _WidgetInfo('Blog1', 'main', document.getElementById('Blog1'), {'cmtInteractionsEnabled': false, 'lightboxEnabled': true, 'lightboxModuleUrl': 'https://www.blogger.com/static/v1/jsbin/1053750561-lbx.js', 'lightboxCssUrl': 'https://www.blogger.com/static/v1/v-css/828616780-lightbox_bundle.css'}, 'displayModeFull')); _WidgetManager._RegisterWidget('_AdSenseView', new _WidgetInfo('AdSense2', 'sidebar', document.getElementById('AdSense2'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_BlogArchiveView', new _WidgetInfo('BlogArchive1', 'sidebar', document.getElementById('BlogArchive1'), {'languageDirection': 'ltr', 'loadingMessage': 'Loading\x26hellip;'}, 'displayModeFull')); _WidgetManager._RegisterWidget('_ProfileView', new _WidgetInfo('Profile1', 'sidebar', document.getElementById('Profile1'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_AdSenseView', new _WidgetInfo('AdSense1', 'footer', document.getElementById('AdSense1'), {}, 'displayModeFull')); </script> </body> </html>