{"id":4014,"date":"2014-11-11T20:31:36","date_gmt":"2014-11-11T20:31:36","guid":{"rendered":"http:\/\/www.crimsondesigns.com\/blog\/?p=4014"},"modified":"2019-08-22T17:13:04","modified_gmt":"2019-08-22T17:13:04","slug":"smooth-strides-from-html-to-html5","status":"publish","type":"post","link":"https:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-html-to-html5\/","title":{"rendered":"Smooth Strides from HTML to HTML5"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignright wp-image-4038 size-full\" src=\"http:\/\/www.crimsondesigns.com\/blog\/wp-content\/uploads\/2014\/11\/html-to-html5.gif\" alt=\"Smooth Strides from HTML to HTML5\" width=\"300\" height=\"385\" \/>This beginner <strong>HTML5<\/strong> tutorial will help you make smooth strides towards a basic understanding\u00a0of <strong>HTML<\/strong> and <strong>HTML5.<\/strong> You&#8217;ll become familiar with these three related terms: <span class=\"special\"><strong>Elements, Tags and Attributes<\/strong><\/span><strong>.<\/strong><\/p>\n<p>Along the way, you may stumble across a few tricky patches related to browser support and the nesting of elements, but we&#8217;ll have you back on your feet in no time as we reach the conclusion. Let&#8217;s get started.<\/p>\n<p>NOTE: This is a companion tutorial to &#8220;<a href=\"https:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-css-to-css3\/\">Smooth Strides from CSS to CSS3.<\/a>&#8221;<\/p>\n<p><!--more--><\/p>\n<p><strong>HTML5<\/strong> is the latest version of <strong>HTML,<\/strong> the standard markup language used to create web pages. <strong>HTML<\/strong> is written in the form of elements consisting of <strong>TAGS<\/strong> enclosed in angle brackets ( like &lt;html&gt; ).<\/p>\n<p>You can&#8217;t actually see <strong>HTML<\/strong> when you look at a web page in a browser. It can only be seen in the source code. Web browsers read the code and then produce the web page that you see on the screen.<\/p>\n<p><strong>HTML5&#8217;s goal<\/strong> is to make it easier to create web pages than in the past by offering a simple syntax and many new capabilities. It is also supposed to help make a cleaner and more efficient World Wide Web.<\/p>\n<h3>Let&#8217;s Create a Page about Speed Skating.<\/h3>\n<p>Let&#8217;s say that you&#8217;re interested in creating a web page that is all about <span class=\"special\">&#8220;speed skating.&#8221;<\/span> You have an image of a speed skater and a lot to say about the subject. You also want to code your web page from scratch.<\/p>\n<h4>You can create your HTML document in a plain text editor.<\/h4>\n<p>Your HTML5 page will start with this: <strong>&lt;!DOCTYPE html&gt;<\/strong><\/p>\n<p><strong>&lt;!DOCTYPE html&gt;<\/strong> goes at the top of every HTML5 page.<br \/>\n<strong>&lt;!DOCTYPE html&gt;<\/strong> means &#8220;this page is written in HTML5.&#8221;<\/p>\n<p>Next you&#8217;ll add some elements. (We&#8217;ll start slow, then pick up speed.) You will add some old <strong>HTML<\/strong> elements and some elements that are new to <strong>HTML5.<\/strong><\/p>\n<p><strong>What are HTML Elements?<\/strong> HTML elements consist of a start tag, content, and an end tag. They&#8217;re really quite simple. These elements are nested together in a web page.<\/p>\n<p>Examples of elements: head, body, p<br \/>\nExamples of elements as tags: <strong>&lt;head&gt;<\/strong>, <strong>&lt;body&gt;<\/strong>, <strong>&lt;p&gt;<\/strong><br \/>\nAn element becomes a tag when we use the angle brackets around it. To create a web page, we use those tags to instruct the web browser. A start tag begins a particular HTML instruction. An end tag ends it.<\/p>\n<p><strong><span class=\"special\">NOTE: Some tags have no end tags.<\/span><\/strong><\/p>\n<p>The first element we&#8217;ll add is the HTML element.<br \/>\nThe opening (start) tag is <strong>&lt;html&gt;<\/strong>. The closing (end) tag is <strong>&lt;\/html&gt;<\/strong>. The only difference is the &#8220;\/&#8221; in the closing tag.<\/p>\n<p><strong>&lt;html&gt; \u2026 &lt;\/html&gt;<\/strong><\/p>\n<p>These &lt;html&gt; tags surround everything else you will add to your page except <strong>&lt;!DOCTYPE html&gt;<\/strong><\/p>\n<h3>Proper Nesting of Elements<\/h3>\n<p>With HTML, elements are nested inside other elements.<\/p>\n<p>For those elements with closing tags, that have another element inside of them, be sure to close the inner element before closing its containing element. <strong>HTML5<\/strong> is pretty forgiving but this will make your code easier to read. So since the HTML element contains everything except <strong>&lt;!DOCTYPE html&gt;<\/strong>, all other elements with closing tags must be closed before you add the closing <strong>&lt;\/html&gt;<\/strong> tag to the document.<\/p>\n<p>Let&#8217;s take a closer look at HTML elements in Part Two.<\/p>\n<ul class=\"table-of-paginated-contents\">\n<li><a class=\"current_page\" href=\"https:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-html-to-html5\/\">Intro<\/a><\/li>\n<li><a href=\"https:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-html-to-html5\/2\/\">Part Two &#8211; A Closer Look at HTML Elements<\/a><\/li>\n<li><a href=\"https:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-html-to-html5\/3\/\">Part Three &#8211; Common HTML Body Elements<\/a><\/li>\n<li><a href=\"https:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-html-to-html5\/4\/\">Part Four &#8211; New HTML5 Elements<\/a><\/li>\n<li><a href=\"https:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-html-to-html5\/5\/\">Part Five &#8211; A Quick Look at HTML5 Content Models<\/a><\/li>\n<li><a href=\"https:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-html-to-html5\/6\/\">Part Six &#8211; Browser Support for HTML5 Elements<\/a><\/li>\n<\/ul>\n<p><!--nextpage--><\/p>\n<h3>Part Two: A Closer Look at HTML Elements<\/h3>\n<p>We started adding some markup tags to our <strong>HTML5<\/strong> page in <strong>Part One<\/strong> of this tutorial. This is what we have so far.<\/p>\n<div class=\"highlight2\"><strong>&lt;!DOCTYPE html&gt;<\/strong><br \/>\n<strong> &lt;html&gt;<\/strong><br \/>\n<strong> \u2026\u2026\u2026\u2026\u2026 <\/strong><br \/>\n<strong> &lt;\/html&gt;<\/strong><\/div>\n<p><a href=\"http:\/\/www.crimsondesigns.com\/blog\/wp-content\/uploads\/2014\/11\/html-element.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright wp-image-4032 size-full\" src=\"http:\/\/www.crimsondesigns.com\/blog\/wp-content\/uploads\/2014\/11\/html-element.png\" alt=\"html element\" width=\"300\" height=\"278\" \/><\/a>You are on your way to becoming familiar with these three related terms: <span class=\"special\"><strong>Elements, Tags and Attributes<\/strong><\/span><strong>.<\/strong><\/p>\n<p>Let&#8217;s take a closer look at elements. Each element\u00a0in an <strong>HTML5<\/strong> document is named to represent what it does. Each tag in an element can have attributes. An attribute is placed inside the element&#8217;s opening (start) tag. Attributes define the characteristics of an <strong>HTML<\/strong> element. They may sound boring but they help <strong>HTML<\/strong> and <strong>CSS<\/strong> work together as a team.<\/p>\n<p><strong>Example: &lt;p class=&#8221;intro&#8221;&gt; &#8230;&lt;\/p&gt;<\/strong><\/p>\n<p><strong>P is our Tag name.<\/strong><br \/>\n<strong>Class is our Attribute name.<\/strong><br \/>\n<strong>Intro is our Attribute value.<\/strong><\/p>\n<p>Back to Our HTML Document:<\/p>\n<p>Change your opening &lt;html&gt; tag to &lt;html lang=&#8221;en&#8221;&gt; <strong>Lang<\/strong> is the attribute name in this instance. It describes the content language with a <strong>value<\/strong> of\u00a0 &#8220;en&#8221; meaning &#8220;english.&#8221;<br \/>\nSo now our page looks like this:<\/p>\n<div class=\"highlight2\"><strong>&lt;!DOCTYPE html&gt;<\/strong><br \/>\n<strong> &lt;html lang=&#8221;en&#8221;&gt;<\/strong><br \/>\n<strong> \u2026\u2026\u2026\u2026\u2026 <\/strong><br \/>\n<strong> &lt;\/html&gt;<\/strong><\/div>\n<p>You will also need a pair of <strong>&lt;head&gt;<\/strong> and <strong>&lt;body&gt;<\/strong> tags in your document.<\/p>\n<h4>The head element<br \/>\n&lt;head&gt; \u2026 &lt;\/head&gt;<\/h4>\n<p><strong>&lt;head&gt;<\/strong> is where you store things like the TITLE of your page, META TAGS, as well as LINK TAGS that connect to external CSS and Javascript files.\u00a0For <a href=\"http:\/\/searchengineland.com\/guide\/what-is-seo\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>SEO<\/strong><\/a> (search engine optimization) purposes, you need title and meta tags included in the head section of your page.<\/p>\n<h4>The title element<br \/>\n&lt;title&gt; \u2026 &lt;\/title&gt;<\/h4>\n<p><strong>&lt;title&gt;<\/strong>The History of Speed Skating<strong>&lt;\/title&gt;.<\/strong> The title doesn&#8217;t appear in a web page but does show in the bar across the top of the browser. It is important to search engines. Be sure to include it.<\/p>\n<h4>The meta element<br \/>\n&lt;meta&gt;<\/h4>\n<p><strong>Meta<\/strong> elements also go in the head element.<\/p>\n<ul>\n<li>The charset meta tag:<br \/>\n<strong>&lt;meta charset=&#8221;utf-8&#8243;&gt;<\/strong> This tag tells the browser what type of letters the page is written in.<\/li>\n<li>The description meta tag:<br \/>\n<strong>&lt;meta name=&#8221;description&#8221; content=&#8221;<\/strong>This tag has information that is important to the search engines. It describes your page.<strong>&#8220;&gt;.<\/strong><\/li>\n<\/ul>\n<h4>The link element<br \/>\n&lt;link&gt;<\/h4>\n<p><strong>Link <\/strong>&#8211; The link element is used to connect external files. Here, we will use the link tag to refer to an externally stored CSS style sheet named &#8220;style.css.&#8221; HTML5&#8217;s sidekick CSS3 keeps all of its code in the style sheet and the two documents can communicate, so to speak, if you use the link tag correctly in your HTML5 document.<\/p>\n<p><strong>&lt;link rel=&#8221;stylesheet&#8221; href=&#8221;style.css&#8221;&gt;<\/strong><\/p>\n<p><strong>NOTE:<\/strong> Meta and link elements do not need closing tags. Elements like these are called Void Elements. Void elements aren&#8217;t designed to contain text or other elements. These are the most well-known void elements:<strong> link, meta,img, br and input.<\/strong><\/p>\n<p>Let&#8217;s see what we have so far:<\/p>\n<div class=\"highlight2\"><strong>&lt;!DOCTYPE html&gt;<\/strong><br \/>\n<strong> &lt;html lang=&#8221;en&#8221;&gt;<\/strong><br \/>\n<strong> &lt;head&gt;<\/strong><br \/>\n<strong> &lt;title&gt;<\/strong>Page Title Goes Here<strong>&lt;\/title&gt;<\/strong><br \/>\n<strong> &lt;meta charset=&#8221;utf-8&#8243;&gt;<\/strong><br \/>\n<strong> &lt;meta name=&#8221;description&#8221; content=&#8221;<\/strong>Describe your page here using sentences.&#8221;<strong>&gt;<\/strong><br \/>\n<strong> &lt;link rel=&#8221;stylesheet&#8221; href=&#8221;style.css&#8221;&gt;<\/strong><br \/>\n<strong> &lt;\/head&gt;<\/strong><br \/>\n<strong> &lt;body&gt;<\/strong><br \/>\n<strong> \u2026\u2026\u2026\u2026\u2026<\/strong><br \/>\n<strong> &lt;\/body&gt;<\/strong><br \/>\n<strong> &lt;\/html&gt;<\/strong><\/div>\n<h4>The body \u00a0element<br \/>\n&lt;body&gt; \u2026 &lt;\/body&gt;<\/h4>\n<p>The <strong>body<\/strong> element\u00a0contains the code that web browsers use to generate what you see on your computer screen. We will nest some common HTML elements inside our body element.<\/p>\n<ul class=\"table-of-paginated-contents\">\n<li><a class=\"current_page\" href=\"https:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-html-to-html5\/\">Intro<\/a><\/li>\n<li><a href=\"https:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-html-to-html5\/2\/\">Part Two &#8211; A Closer Look at HTML Elements<\/a><\/li>\n<li><a href=\"https:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-html-to-html5\/3\/\">Part Three &#8211; Common HTML Body Elements<\/a><\/li>\n<li><a href=\"https:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-html-to-html5\/4\/\">Part Four &#8211; New HTML5 Elements<\/a><\/li>\n<li><a href=\"https:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-html-to-html5\/5\/\">Part Five &#8211; A Quick Look at HTML5 Content Models<\/a><\/li>\n<li><a href=\"https:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-html-to-html5\/6\/\">Part Six &#8211; Browser Support for HTML5 Elements<\/a><\/li>\n<\/ul>\n<p><!--nextpage--><\/p>\n<h3><a href=\"http:\/\/www.crimsondesigns.com\/blog\/wp-content\/uploads\/2014\/11\/html-terms.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright wp-image-4033 size-full\" src=\"http:\/\/www.crimsondesigns.com\/blog\/wp-content\/uploads\/2014\/11\/html-terms.jpg\" alt=\"HTML Terms - elements, tags, attributes\" width=\"300\" height=\"350\" srcset=\"https:\/\/www.crimsondesigns.com\/blog\/wp-content\/uploads\/2014\/11\/html-terms.jpg 300w, https:\/\/www.crimsondesigns.com\/blog\/wp-content\/uploads\/2014\/11\/html-terms-257x300.jpg 257w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>Part Three: Common HTML Body Elements<\/h3>\n<h4>heading elements<br \/>\n&lt;h1&gt;, &lt;h2&gt;, &lt;h3&gt;, &lt;h4&gt;, &lt;h5&gt;, &lt;h6&gt;<\/h4>\n<p>Heading elements, as their name suggests, are used to differentiate the heading of a page from the rest of the content.\u00a0These are not to be confused between the previously mentioned <strong>head<\/strong> and <strong>header<\/strong> elements. Yes\u2026 there really are <strong>head,<\/strong> <strong>header<\/strong> and <strong>heading<\/strong> elements in <strong>HTML<\/strong> pages.<\/p>\n<p>The most important heading element is the <strong>h1<\/strong>\u00a0element and least important is the <strong>h6<\/strong>\u00a0element. Every page should have an <strong>h1<\/strong>\u00a0element. Search engine spiders pay attention to the words used in the h1 element. h1 elements are important for <strong>SEO.<\/strong><\/p>\n<h4>The p\u00a0element<br \/>\n&lt;p&gt;&#8230;&lt;\/p&gt;<\/h4>\n<p>The <strong>p<\/strong> element is probably the handiest and most commonly used of all HTML elements.<\/p>\n<p><span class=\"special\"><strong>Example:<\/strong> <strong>&lt;p&gt;<\/strong>Did you know? Speed skating dates back over a thousand years to Scandinavia and the Netherlands.<strong>&lt;\/p&gt;<\/strong><\/span><\/p>\n<h4>The img (image) element<br \/>\n<strong>&lt;img&gt;<\/strong><\/h4>\n<p>The <strong>img<\/strong> element provides a means for embedding an image in the document. In the example below, the <strong>img<\/strong> element provides a reference to the image file to display, and a text alternative should the image not be available, for whatever reason.<\/p>\n<p><strong>&lt;img src=&#8221;speed-skater.jpg&#8221; alt=&#8221;<\/strong>speed skater with tight green spandex suit<strong>&#8221; class=&#8221;floatRight&#8221;&gt;<\/strong><\/p>\n<p>In our example above, we have three<strong> Attributes<\/strong> and three <strong>Values <\/strong>(in quotes) to describe our image of a speed skater. We can and should also use <strong>width<\/strong> and <strong>height<\/strong> attributes.<\/p>\n<p><strong>NOTE: <\/strong>Our class attribute, in the example, doesn&#8217;t do anything all by itself. It needs the help of CSS. <strong><br \/>\n<\/strong><\/p>\n<p>Let&#8217;s see what we have so far:<\/p>\n<div class=\"highlight2\"><strong>&lt;!DOCTYPE html&gt;<\/strong><br \/>\n<strong> &lt;html lang=&#8221;en&#8221;&gt;<\/strong><br \/>\n<strong> &lt;head&gt;<\/strong><br \/>\n<strong> &lt;title&gt;<\/strong>Page Title Goes Here<strong>&lt;\/title&gt;<\/strong><br \/>\n<strong> &lt;meta charset=&#8221;utf-8&#8243;&gt;<\/strong><br \/>\n<strong> &lt;meta name=&#8221;description&#8221; content=&#8221;<\/strong>Describe your page here using sentences.<strong>&#8220;&gt;<\/strong><br \/>\n<strong> &lt;link rel=&#8221;stylesheet&#8221; href=&#8221;style.css&#8221;&gt;<\/strong><br \/>\n<strong> &lt;\/head&gt;<\/strong><br \/>\n<strong> &lt;body&gt;<\/strong><br \/>\n<span class=\"special\"><strong>&lt;p&gt;<\/strong><\/span><strong>&lt;img src=&#8221;speed-skater.jpg&#8221; alt=&#8221;<\/strong>speed skater with tight green spandex suit<strong>&#8221; class=&#8221;floatRight&#8221;&gt;<\/strong><span class=\"special\"> Did you know? Speed skating dates back over a thousand years to Scandinavia and the Netherlands.<strong>&lt;\/p&gt;<\/strong><\/span><br \/>\n<strong> &lt;\/body&gt;<\/strong><br \/>\n<strong> &lt;\/html&gt;<\/strong><\/div>\n<p>In our example, we added our <strong>p<\/strong> element and nested our <strong>img<\/strong> element inside. We closed our <strong>p<\/strong> element with an end tag &lt;\/p&gt;, but not our <strong>img<\/strong> element, since it is a VOID element.<\/p>\n<p>NOTE: If we were to see our page in a browser, we would only see a paragraph and an image of a speed skater on the page (as long as there is a real image included with the web page).<\/p>\n<p>Now let&#8217;s take a close look at some new <strong>HTML5<\/strong> Elements that are supposed to help make a cleaner and more efficient World Wide Web.<\/p>\n<ul class=\"table-of-paginated-contents\">\n<li><a class=\"current_page\" href=\"https:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-html-to-html5\/\">Intro<\/a><\/li>\n<li><a href=\"https:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-html-to-html5\/2\/\">Part Two &#8211; A Closer Look at HTML Elements<\/a><\/li>\n<li><a href=\"https:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-html-to-html5\/3\/\">Part Three &#8211; Common HTML Body Elements<\/a><\/li>\n<li><a href=\"https:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-html-to-html5\/4\/\">Part Four &#8211; New HTML5 Elements<\/a><\/li>\n<li><a href=\"https:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-html-to-html5\/5\/\">Part Five &#8211; A Quick Look at HTML5 Content Models<\/a><\/li>\n<li><a href=\"https:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-html-to-html5\/6\/\">Part Six &#8211; Browser Support for HTML5 Elements<\/a><\/li>\n<\/ul>\n<p><!--nextpage--><\/p>\n<h3>Part Four: New HTML5 Semantic\/Structural Elements<\/h3>\n<p><strong><a href=\"http:\/\/www.crimsondesigns.com\/blog\/wp-content\/uploads\/2014\/11\/html5-page-layout.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright wp-image-4028 size-full\" src=\"http:\/\/www.crimsondesigns.com\/blog\/wp-content\/uploads\/2014\/11\/html5-page-layout.png\" alt=\"HTML5 page layout\" width=\"280\" height=\"312\" srcset=\"https:\/\/www.crimsondesigns.com\/blog\/wp-content\/uploads\/2014\/11\/html5-page-layout.png 280w, https:\/\/www.crimsondesigns.com\/blog\/wp-content\/uploads\/2014\/11\/html5-page-layout-269x300.png 269w\" sizes=\"auto, (max-width: 280px) 100vw, 280px\" \/><\/a>HTML5<\/strong> has made what are known as <strong>&#8220;sectioning elements&#8221;<\/strong> available. Sectioning elements are supposed to help improve page structure, but they can get confusing. So let&#8217;s just learn the basics here, then glance at the content marked as side notes, and move on. The side notes will show that there is much more to learn, but you don&#8217;t need to understand them to get started using HTML5.<\/p>\n<h3>Let&#8217;s learn 6 Basic HTML5 Elements:<\/h3>\n<h4>1) header element<br \/>\n&lt;header&gt;\u2026&lt;\/header&gt;<\/h4>\n<p><strong>Header<\/strong> is a new HTML5 element. It has a different purpose than the &lt;head&gt; tag you learned in Part One. Don&#8217;t confuse the two tags.<\/p>\n<p>The <strong>header element<\/strong> is at the top of almost every HTML5 page (in the body section). Header is where you\u2019ll likely name your business and store a logo for your web page. In the past, we often wrote &lt;div id=&#8221;header&#8221;&gt;. Now we can just write &lt;header&gt;.<\/p>\n<aside class=\"side note\"><strong>Side Note:<\/strong> You can actually have several &lt;header&gt; tags in one document. But one will suffice.<\/aside>\n<h4>2) nav element<br \/>\n&lt;nav&gt;\u2026&lt;\/nav&gt;<\/h4>\n<p><strong>Nav<\/strong> is a new HTML5 element with a clear purpose. <strong>Nav<\/strong> is used for the navigation bar and is where you\u2019ll store links to other web pages.<\/p>\n<aside class=\"side note\"><strong>Side Note:<\/strong> You can have more than one &lt;nav&gt; tag in an HTML5 page.<\/aside>\n<h4>3) aside element<br \/>\n&lt;aside&gt;\u2026&lt;\/aside&gt;<\/h4>\n<p><strong>The aside element<\/strong> &#8211; <strong>Aside<\/strong> is another new HTML5 element that can be used for sidebars, for groups of <strong>nav<\/strong> elements and for other content that is considered separate from the main content of the page. In the past, we often wrote &lt;div id=&#8221;sidebar&#8221;&gt;.\u00a0 Now we can just write &lt;aside&gt;.<\/p>\n<h4>4) footer element<br \/>\n&lt;footer&gt;\u2026&lt;\/footer&gt;<\/h4>\n<p>The footer element is also new. It is where you should store contact information, copyright information and perhaps a couple of links. In the old days, designers used to write &lt;div id=&#8221;footer&#8221;&gt;. Now we can write &lt;footer&gt; instead.<\/p>\n<aside class=\"side note\"><strong>Side Note:<\/strong> You can have several &lt;footer&gt; tags in one document. Each &lt;footer&gt; becomes the &lt;footer&gt; for that section of the document.<\/aside>\n<h4>5)\u00a0 section element<br \/>\n&lt;section&gt;&lt;\/section&gt;<\/h4>\n<p>The <strong>section element<\/strong> lets you define a generic section of content. The section element should have a <strong>heading element<\/strong> in it &#8211; Example: <strong>&lt;h1&gt;<\/strong>All About Speed Skating<strong>&lt;\/h1&gt;<\/strong>.<\/p>\n<h4>6) article element<br \/>\n&lt;article&gt;&lt;\/article&gt;<\/h4>\n<p>The <strong>article element<\/strong> should contain things like blog posts and news stories. This element and its contents should be able to be detached from the rest of the page with the page remaining coherent. An <strong>article element<\/strong> typically has a heading and sometimes a footer.<\/p>\n<aside class=\"side note\"><strong>Side Note:<\/strong> You can nest <strong>article elements<\/strong> within one another. It\u2019s implied that the nested elements are related to the outer <strong>article element.<\/strong>You will also find that many HTML5 pages have <strong>section elements<\/strong> containing <strong>article elements<\/strong> and <strong>article elements<\/strong> containing <strong>sections elements. Whew! That gets a little confusing. Don&#8217;t worry about this. It&#8217;s just a side note.<br \/>\n<\/strong><\/aside>\n<p>Now you&#8217;ve seen 6 HTML5 Elements. You can use the new HTML5 elements with the old HTML elements in your page. But you can&#8217;t position these elements as you see in the example without the help of CSS.<\/p>\n<h3>A Close Look at One Popular HTML Element<\/h3>\n<h4>The &#8220;Good Old&#8221; div element<br \/>\n&lt;div&gt;\u2026&lt;\/div&gt;<\/h4>\n<p><a href=\"http:\/\/www.crimsondesigns.com\/blog\/wp-content\/uploads\/2014\/11\/div-id-wrapper1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright wp-image-4031 size-full\" src=\"http:\/\/www.crimsondesigns.com\/blog\/wp-content\/uploads\/2014\/11\/div-id-wrapper1.png\" alt=\"HTML div element\" width=\"280\" height=\"312\" srcset=\"https:\/\/www.crimsondesigns.com\/blog\/wp-content\/uploads\/2014\/11\/div-id-wrapper1.png 280w, https:\/\/www.crimsondesigns.com\/blog\/wp-content\/uploads\/2014\/11\/div-id-wrapper1-269x300.png 269w\" sizes=\"auto, (max-width: 280px) 100vw, 280px\" \/><\/a>The HTML <strong>div element<\/strong> is an element that has been used, and perhaps overused, as a container for other HTML elements for a long time.<\/p>\n<p>The <strong>div <\/strong>element is used to identify any particular part of a web page. It can include an entire web page, or just the first line of a paragraph. <span class=\"special\">The <strong>div<\/strong> element has no special meaning. It is not semantic.<\/span> When used together with CSS, the div element can be used to style blocks of content.<\/p>\n<p><strong>&lt;div id=&#8221;wrapper&#8221;&gt;<\/strong><br \/>\nHere we created a &lt;div&gt;\u00a0with an <strong>id<\/strong> of &#8220;wrapper.&#8221; <strong>ID<\/strong> is the attribute and &#8220;wrapper&#8221; is the value.<\/p>\n<p>We can use the attribute and value to style the look of the page with the help of the linked CSS document. It may not look exciting right now. But HTML5 and CSS3 are pretty amazing together.<\/p>\n<p>Many people like to use the <strong>div element<\/strong> as top-level container for styling the entire site. This is an appropriate use of div element, as a site wrapper has no purpose other than to aid styling. The use of <strong>&lt;div&gt;<\/strong> will continue to decline in the future in favor of the new semantic elements.<\/p>\n<h3>HTML Block Elements and Inline Elements<\/h3>\n<p>Most HTML elements &#8220;used to&#8221; be defined as block-level elements or inline elements.\u00a0Block-level elements act as <strong>&#8220;containers&#8221;<\/strong> for other elements. In other words, you put other elements inside block elements.\u00a0An inline element is an element that defined text or data in the document. <strong>&lt;strong&gt;<\/strong> for example is an element that makes the enclosed text strongly emphasized. It used to be considered an inline element.<\/p>\n<p>Inline elements are ones without widths or heights. (NOTE: The paragraph is\u00a0the only block element that can only contain inline elements.) So why am I explaining this if everything has changed in HTML5? Well, it seems that we commonly still think of elements in these terms.<\/p>\n<ul class=\"table-of-paginated-contents\">\n<li><a class=\"current_page\" href=\"https:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-html-to-html5\/\">Intro<\/a><\/li>\n<li><a href=\"https:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-html-to-html5\/2\/\">Part Two &#8211; A Closer Look at HTML Elements<\/a><\/li>\n<li><a href=\"https:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-html-to-html5\/3\/\">Part Three &#8211; Common HTML Body Elements<\/a><\/li>\n<li><a href=\"https:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-html-to-html5\/4\/\">Part Four &#8211; New HTML5 Elements<\/a><\/li>\n<li><a href=\"https:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-html-to-html5\/5\/\">Part Five &#8211; A Quick Look at HTML5 Content Models<\/a><\/li>\n<li><a href=\"https:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-html-to-html5\/6\/\">Part Six &#8211; Browser Support for HTML5 Elements<\/a><\/li>\n<\/ul>\n<p><!--nextpage--><\/p>\n<h3>Part Five: A Quick Look at HTML5&#8217;s Content Models<\/h3>\n<p><a href=\"http:\/\/www.crimsondesigns.com\/blog\/wp-content\/uploads\/2014\/11\/HTML5-content-models.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright wp-image-4029 size-full\" src=\"http:\/\/www.crimsondesigns.com\/blog\/wp-content\/uploads\/2014\/11\/HTML5-content-models.gif\" alt=\"HTML5 Content Models\" width=\"303\" height=\"200\" \/><\/a>In <strong>HTML5,<\/strong> however, each element belongs to one (or more) of seven different categories: <strong>metadata\u00a0content, flow content, sectioning content, heading content, phrasing content, embedded content, <\/strong>or<strong> interactive content.<\/strong><\/p>\n<h4>Flow and Phrasing Content<\/h4>\n<p><span class=\"special\">Flow Content<\/span> &#8211; Most elements that are used in the body of documents and applications are categorized as flow content (ex. article, nav, div, h1, p)<\/p>\n<p><span class=\"special\">Phrasing Content<\/span> &#8211; Most elements that are categorized as &#8220;phrasing content&#8221; can only contain elements that are themselves categorized as phrasing content, not any flow content . Phrasing content is similar to inline-elements (ex. span, strong). They are at the bottom of the totem pole, so to speak, in terms of hierarchy.<\/p>\n<p>But web browsers still display content primarily using those two old definitions: <strong>block-level<\/strong> and <strong>inline-level. You will continue to hear about these terms for some time to come.<br \/>\n<\/strong><\/p>\n<p><strong>What you need to know:<\/strong> Inline-level elements typically occur within block-level elements. Images and links are\u00a0 examples of inline-level elements.<\/p>\n<p><strong>In Simple Terms:<\/strong> You wouldn&#8217;t nest a paragraph inside an image. But you can nest an image inside a paragraph.<\/p>\n<h4>Another Old HTML Element<\/h4>\n<h4>The \u00a0span element<br \/>\n&lt;span&gt;\u2026&lt;\/span&gt;<\/h4>\n<p>The HTML <strong>span element<\/strong> used to be referred to as\u00a0an inline element. The <strong>span element<\/strong> has no special meaning. When used together with CSS, the <strong>span element<\/strong> can style parts of text. You can&#8217;t nest block level elements such as DIVs or paragraphs inside a <strong>span element.<\/strong> But you can have <strong>span elements<\/strong> inside paragraphs and DIVs.<\/p>\n<p><strong>&lt;p&gt;&lt;span class=&#8221;special&#8221;&gt;Welcome&lt;\/span&gt; Friends.&lt;\/p&gt;<\/strong><\/p>\n<p>With the help of our linked CSS document, we can change the word &#8220;Welcome&#8221; that is in our <strong>span<\/strong> element to a different color.<\/p>\n<h3>Deprecated Elements<\/h3>\n<p>Elements and attributes sometimes become deprecated as HTML continues to evolve. A deprecated element or attribute is one that has been outdated or basically &#8220;kicked to the curb&#8221; by the <strong>W3C. <\/strong>The World Wide Web Consortium <strong>(W3C)<\/strong> is an international community where members work together to develop Web standards.<strong><br \/>\n<\/strong><\/p>\n<p>When you finish your web page and put it online, you can see if it validates (conforms to the standards set). Basically, the W3C can help you figure out if you coded it properly. The <strong><a href=\"http:\/\/validator.w3.org\" target=\"_blank\" rel=\"noopener noreferrer\">W3C markup validator<\/a><\/strong> may also tell you if you are using deprecated elements and let you know whether you are nesting your elements properly. It may not use the old terms <strong>&#8220;block elements&#8221;<\/strong> and <strong>&#8220;inline elements.&#8221;\u00a0<\/strong> You may see the words <strong>&#8220;phrasing content&#8221;<\/strong> and <strong>&#8220;flow content&#8221;<\/strong> instead in the review of your page. The validator will help you improve the structure of your web page.<\/p>\n<p>Our very simple web page is almost done. We need to add a couple more important things: some <strong>CSS<\/strong> and <strong>Javascript<\/strong> for Web Browser Support. Let&#8217;s discuss Browser Support in Part 6.<\/p>\n<ul class=\"table-of-paginated-contents\">\n<li><a class=\"current_page\" href=\"https:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-html-to-html5\/\">Intro<\/a><\/li>\n<li><a href=\"https:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-html-to-html5\/2\/\">Part Two &#8211; A Closer Look at HTML Elements<\/a><\/li>\n<li><a href=\"https:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-html-to-html5\/3\/\">Part Three &#8211; Common HTML Body Elements<\/a><\/li>\n<li><a href=\"https:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-html-to-html5\/4\/\">Part Four &#8211; New HTML5 Elements<\/a><\/li>\n<li><a href=\"https:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-html-to-html5\/5\/\">Part Five &#8211; A Quick Look at HTML5 Content Models<\/a><\/li>\n<li><a href=\"https:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-html-to-html5\/6\/\">Part Six &#8211; Browser Support for HTML5 Elements<\/a><\/li>\n<\/ul>\n<p><!--nextpage--><\/p>\n<h3>Part Six: Browser Support for HTML5 Elements<\/h3>\n<p><a href=\"http:\/\/www.crimsondesigns.com\/blog\/wp-content\/uploads\/2014\/11\/html5-browser-support.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright wp-image-4034 size-full\" src=\"http:\/\/www.crimsondesigns.com\/blog\/wp-content\/uploads\/2014\/11\/html5-browser-support.jpg\" alt=\"HTML5 Browser Support\" width=\"287\" height=\"250\" \/><\/a>We&#8217;ve been creating a web page with some HTML and HTML5 elements, but to be sure web browsers understand our new HTML5 elements, we must add a couple more things.<\/p>\n<h4>\u00a0CSS for Browser Support<\/h4>\n<p>Most of the new HTML5 elements we have discussed are supposed to behave like block level elements. To ensure that they do, you will need this code in your linked CSS document.<\/p>\n<p class=\"special\">article, section, aside, nav, header, footer {display: block;}<\/p>\n<p>To learn more about coding a CSS style sheet, see our companion tutorial: <strong>&#8220;<a href=\"http:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-css-to-css3\/\">Smooth Strides from CSS to CSS3.<\/a>&#8220;<\/strong><\/p>\n<h4>Javascript for Browser Support: HTML5 SHIV<\/h4>\n<p>But before that, we should do one more thing:\u00a0For Internet Explorer 8 and below, we need to hack support in via Javascript.\u00a0 Add the code below between your opening and closing <strong>&lt;head&gt;<\/strong> tags below the <strong>&lt;link&gt;<\/strong> tag.<\/p>\n<p><strong>&lt;head&gt;<br \/>\n&lt;!&#8211;[if lt IE 9]&gt;<br \/>\n&lt;script src=&#8221;http:\/\/html5shiv.googlecode.com\/svn\/trunk\/html5.js&#8221;&gt;&lt;\/script&gt;<br \/>\n&lt;![endif]&#8211;&gt;<br \/>\n&lt;\/head&gt;<\/strong><\/p>\n<p>Let&#8217;s take one last look at the basic structure of our speed skating document:<\/p>\n<div class=\"highlight2\"><strong>&lt;!DOCTYPE html&gt;<\/strong><br \/>\n<strong> &lt;html lang=&#8221;en&#8221;&gt;<\/strong><br \/>\n<strong> &lt;head&gt;<\/strong><br \/>\n<strong> &lt;title&gt;<\/strong>Page Title Goes Here<strong>&lt;\/title&gt;<\/strong><br \/>\n<strong>&lt;meta charset=&#8221;utf-8&#8243;&gt;<\/strong><br \/>\n<strong>&lt;meta name=&#8221;description&#8221; content=&#8221;<\/strong>Describe your page here using sentences.<strong>&#8220;&gt;<\/strong><br \/>\n<strong> &lt;link rel=&#8221;stylesheet&#8221; href=&#8221;style.css&#8221;&gt;<\/strong><br \/>\n<span class=\"special\"> &lt;!&#8211;[if lt IE 9]&gt;<br \/>\n&lt;script src=&#8221;http:\/\/html5shiv.googlecode.com\/svn\/trunk\/html5.js&#8221;&gt;&lt;\/script&gt;<br \/>\n<strong> &lt;![endif]&#8211;&gt;<\/strong><\/span><br \/>\n&lt;\/head&gt;<br \/>\n<strong> &lt;body&gt;<\/strong><br \/>\n<strong> &lt;div id=&#8221;wrapper&#8221;&gt;<\/strong><br \/>\n<strong> &lt;header&gt;&#8230;&lt;\/header&gt;<\/strong><br \/>\n<strong> &lt;nav&gt;&#8230;&lt;\/nav&gt;<\/strong><br \/>\n<strong> &lt;section&gt;<br \/>\n&lt;h1&gt;<\/strong>The History of Speed Skating<strong>&lt;\/h1&gt;<br \/>\n&lt;p&gt;&lt;img src=&#8221;speed-skater.jpg&#8221; alt=&#8221;speed skater&#8221; width=&#8221;125&#8243; height=&#8221;250&#8243;&gt;&lt;span class=&#8221;special&#8221;&gt;<\/strong>Did you know?<strong>&lt;\/span&gt;<\/strong> Speed skating dates back over a thousand years to Scandinavia, and the Netherlands, where the natives added bones to their shoes and used them to travel on frozen rivers, canals and lakes?<strong>&lt;\/p&gt;<\/strong><br \/>\n<strong>&lt;p&gt;<\/strong>It was much later, in the 16th century, that people started seeing skating as fun and perhaps even a sporting activity.<strong>&lt;\/p&gt;<\/strong><br \/>\n<strong>&lt;\/section&gt;<br \/>\n&lt;aside&gt;&#8230;&lt;\/aside&gt;<\/strong><br \/>\n<strong> &lt;footer&gt;&#8230;&lt;\/footer&gt;<\/strong><br \/>\n<strong> &lt;\/div&gt;<\/strong><br \/>\n<strong> &lt;\/body&gt;<\/strong><br \/>\n<strong> &lt;\/html&gt;<\/strong><\/div>\n<p>In our example, we&#8217;ve basically created a web page that has structure. To style our web page, we must turn to <strong>CSS<\/strong> and <strong>CSS3<\/strong>. See <strong>&#8220;<a href=\"http:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-css-to-css3\/\">Smooth Strides from CSS to CSS3.<\/a>&#8221;\u00a0<\/strong>In our related tutorial, we will create a <strong>SIMPLE\u00a0HTML5<\/strong> web document and add some styling to it with <strong>CSS3.<\/strong><\/p>\n<ul class=\"table-of-paginated-contents\">\n<li><a class=\"current_page\" href=\"https:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-html-to-html5\/\">Intro<\/a><\/li>\n<li><a href=\"https:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-html-to-html5\/2\/\">Part Two &#8211; A Closer Look at HTML Elements<\/a><\/li>\n<li><a href=\"https:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-html-to-html5\/3\/\">Part Three &#8211; Common HTML Body Elements<\/a><\/li>\n<li><a href=\"https:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-html-to-html5\/4\/\">Part Four &#8211; New HTML5 Elements<\/a><\/li>\n<li><a href=\"https:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-html-to-html5\/5\/\">Part Five &#8211; A Quick Look at HTML5 Content Models<\/a><\/li>\n<li><a href=\"https:\/\/www.crimsondesigns.com\/blog\/smooth-strides-from-html-to-html5\/6\/\">Part Six &#8211; Browser Support for HTML5 Elements<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>This beginner HTML5 tutorial will help you make smooth strides towards a basic understanding of HTML and HTML5. You&#8217;ll become familiar with these three related terms: Elements, Tags and Attributes.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,9],"tags":[50,285,286,92],"class_list":{"0":"post-4014","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-html-and-css","7":"category-web-design","8":"tag-css3","9":"tag-html-elements","10":"tag-html-tags","11":"tag-html5","12":"cat-5-id","13":"cat-9-id"},"_links":{"self":[{"href":"https:\/\/www.crimsondesigns.com\/blog\/wp-json\/wp\/v2\/posts\/4014","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.crimsondesigns.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.crimsondesigns.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.crimsondesigns.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.crimsondesigns.com\/blog\/wp-json\/wp\/v2\/comments?post=4014"}],"version-history":[{"count":0,"href":"https:\/\/www.crimsondesigns.com\/blog\/wp-json\/wp\/v2\/posts\/4014\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.crimsondesigns.com\/blog\/wp-json\/wp\/v2\/media?parent=4014"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.crimsondesigns.com\/blog\/wp-json\/wp\/v2\/categories?post=4014"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.crimsondesigns.com\/blog\/wp-json\/wp\/v2\/tags?post=4014"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}