Skip to content
  • Quizes
  • QStack
  • Blog
  • pinterest
  • instagram
  • twitter
  • linkedin
  • facebook
W3 Coding Schools
  • Home
  • HTML
    • HTML Introduction
    • HTML Editors
    • Fundamentals of HTML
    • Elements of HTML
    • HTML Attributes
    • HTML Headings
    • HTML Paragraphs
    • HTML Style Attribute
    • HTML Text Formatting
    • HTML Phrase Tags
    • HTML Comments
    • HTML with CSS
    • HTML Links
    • HTML Images
    • HTML Tables
    • HTML Lists
    • HTML Blocks
    • HTML Class Attribute
    • HTML Id Attribute
    • HTML Iframes
    • HTML JavaScript
    • HTML File Paths
    • HTML Head
    • Computer Code Elements
    • HTML Entities
    • HTML Charset
    • HTML URL Encode
    • HTML and XHTML
    • HTML Layouts
    • HTML Forms
    • HTML Form Elements
    • HTML Form Input Types
    • HTML Input Attributes
    • HTML5 Introduction
    • HTML5 New Elements
    • Semantic Elements
    • HTML5 Migration
    • Style Guide
    • HTML Canvas
  • CSS
    • CSS Introduction
    • CSS Syntax and CSS Comments
    • CSS Selectors
    • How to add CSS to a Webpage
    • CSS Color Basics
    • CSS Background Properties
    • CSS Border Properties
    • CSS Margin and Padding Properties
    • CSS Height and Width properties
    • CSS Box Model
    • CSS Outline Properties
    • CSS Fonts
    • CSS Text
    • How To Add Icons
    • CSS Links
    • CSS List-Style
    • CSS Tables
    • CSS Display Property
    • CSS Position Property
    • CSS Overflow Property
    • CSS max-width Property
    • CSS Float and Clear Properties
    • CSS Alignment
    • CSS inline-block
    • CSS Combinators
    • CSS Pseudo Classes
    • CSS Pseudo Elements
    • CSS Opacity
    • CSS Navigation Bar
    • CSS Dropdowns
    • CSS Image Gallery
    • CSS Image Sprites
    • CSS Attribute Selector
    • CSS Styling Forms
    • CSS Counters
    • CSS Units
    • CSS Specificity
    • CSS Website Layout
    • CSS Rounded Corners
    • CSS Border Image Property
    • CSS Multiple Backgrounds
    • CSS Gradient
    • CSS Shadow Effects
    • CSS Text Effects
    • CSS Web Fonts
    • CSS 2D Transforms
  • Bootstrap 4
    • Bootstrap 4 – Introduction
    • Bootstrap versions
    • Bootstrap 4 Layout
    • Bootstrap 3 Vs Bootstrap 4
    • Bootstrap 4 Grid System
    • Bootstrap 4 Typography
    • Bootstrap 4 Colors
    • Bootstrap 4 Images
    • Bootstrap 4 Tables
    • Bootstrap 4 Jumbotron
    • Bootstrap 4 Figures
    • Bootstrap 4 Alerts
    • Bootstrap 4 Buttons
    • Bootstrap 4 Button Group
    • Bootstrap 4 Badges
    • Bootstrap 4 Spinners
    • Bootstrap 4 Progress Bars
    • Bootstrap 4 Pagination
    • Bootstrap 4 Breadcrumbs
    • Bootstrap 4 List Groups
    • Bootstrap 4 Cards
  • jQuery
    • jQuery Introduction
    • jQuery Download
    • jQuery Selectors
    • jQuery Event Methods
    • jQuery Hide/Show Effects
    • jQuery Fading Effects
    • jQuery Sliding Effects
    • jQuery Animation
    • jQuery Stop and Callback
    • jQuery Get and Set Methods
    • jQuery Chaining
    • jQuery Add
    • jQuery Remove
    • jQuery CSS Classes
    • jQuery Style Properties
    • jQuery Dimensions
    • jQuery Traversing
    • jQuery Ancestors
    • jQuery Descendants
    • jQuery Siblings
  • Javascript
    • JS Introduction
    • JS Where to Put
    • JavaScript Syntax
    • JavaScript Comments
    • JavaScript Variables
    • JavaScript Data Types
    • JavaScript Operators
    • JavaScript Events
    • JavaScript Strings
    • JavaScript Numbers
  • php
    • PHP Introduction
    • Install PHP
    • PHP Syntax and Comments
    • PHP Variables
    • PHP Constants
    • PHP Echo and Print
    • PHP Data Types
    • PHP Strings
    • PHP Operators
    • PHP $ and $$ Variables
  • WordPress
    • WordPress Introduction
    • WordPress History
    • WordPress.com vs WordPress.org
    • How to Install WordPress
    • WordPress Dashboard
    • How to Create a WordPress Website
    • WordPress Posts
    • WordPress Pages
    • WordPress Posts vs Pages
    • WordPress Categories
  • SEO
    • SEO Introduction
    • SEO Tactics and Methods
    • SEO Relevant Filenames
    • SEO Domain Name
    • Website Design and SEO
    • SEO Keywords
    • Meta Tags Optimization
    • Title Tag Optimization
    • Anchor Text Optimization
    • Content Optimization
  • Android
    • Android Introduction
    • Android History and Versions
    • Android Architecture
    • Android Environment Setup
    • Android Application Components
    • Hello World Application
    • Android Activities
  • iOS
    • iOS Introduction
    • iOS Environment Setup
    • iOS Architecture

You Are Here

  • Home
  • Learn HTML
  • HTML5 Migration

Topics

  • HTML Introduction
  • HTML Editors
  • Fundamentals of HTML
  • HTML Elements
  • HTML Attributes
  • HTML Headings
  • HTML Paragraphs
  • HTML Style Attribute
  • HTML Text Formatting
  • HTML Phrase Tags
  • HTML Comments
  • HTML with CSS
  • HTML Links
  • HTML Images
  • HTML Tables
  • HTML Lists
  • HTML Blocks
  • HTML Class Attribute
  • Id Attribute for HTML
  • HTML Iframes
  • HTML JavaScript
  • HTML File Paths
  • HTML Head
  • HTML Computer Code Elements
  • HTML Entities
  • HTML Charset
  • HTML URL Encode
  • HTML and XHTML
  • HTML Layouts
  • HTML Forms
  • HTML Form Elements
  • HTML Form Input Types
  • HTML Input Attributes
  • HTML5 Introduction
  • HTML5 New Elements
  • Semantic Elements in HTML5
  • HTML5 Migration
  • Style Guide
  • HTML Canvas
  • HTML SVG

Oct Champs & Prizes

  • 1. Pooja Ladda
  • 2. Manjali Kuldharan
  • 3. Pranali Surawar
  • 4. Anjali Kulkarni
  • 5. Vishal Deshmukh

Recent Posts

  • HTML Media
  • jQuery Siblings
  • Bootstrap 4 Cards
  • jQuery Descendants
  • jQuery Ancestors

HTML5 Migration

Migration in HTML5 defines how to migrate from HTML4 to HTML5. Let’s see how the migration of the HTML4 page can be done into an HTML5 page without any problem in content or structure.
The HTML5 has new features and improvements to existing features. It includes all the elements that are present in the HTML4 and XHTML. HTML5 includes the redefinition of the existing markup elements.
The redefinition of the HTML4 elements to the HTML5 is given below:
HTML4 HTML5
<div id = “header”> <header>
<div id = “menu”> <nav>
<div id = “content”> <section>
<div id = “article”> <article>
<div id = “footer”> <footer>
Difference between an HTML4 and HTML5 document:
Lets see the following example:

Example:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title> HTML4 </title>
<style>
body {
font-family: Arial,sans-serif;
font-size: 1em;
}
div#header, div#footer {
padding: 15px;
color: white;
background-color: #ff5722;
}
div#content {
margin: 6px;
padding: 15px;
background-color: #ff5722;
}
div.article {
margin: 6px;
padding: 15px;
background-color: white;
}
div#menu ul {
padding: 0;
}
div#menu ul li {
display: inline;
margin: 6px;
}
</style>
</head>
<body>
<div id="header">
<h2> W3CodingSchools </h2>
</div>
<div id="menu">
<ul>
<li> HTML </li>
<li> CSS </li>
<li> Bootstrap </li>
</ul>
</div>
<div id="content">
<h2> Tutorials </h2>
<div class="article">
<h2> HTML </h2>
<p> HTML is a markup language using which you can create your website. HTML stands for Hypertext Markup Language. It contains elements and the elements are represented by tags. You can create a static webpage by using HTML only. Technically HTML is not a programming language it is a markup language. </p>
</div>
<div class="article">
<h2> CSS </h2>
<p> CSS is the acronym for Cascading Style Sheets. It is widely used language on the web. Styles are set using CSS properties. For example, you can set font properties (size, colors, style etc), background color, border styles, and much more. Which describe the look and formatting of a document written in markup language. External stylesheets are stored in CSS files. </p>
</div>
<div class="article">
<h2> Bootstrap </h2>
<p> Bootstrap is the most popular HTML, CSS, and JavaScript framework for developing responsive and mobile-friendly websites or web applications. It also gives you the ability to create Responsive Web Designs. It is an open-source framework and free to download and use. It is the most popular front-end framework used for faster and easier to develop web applications or websites. </p>
</div>
</div>
<div id="footer">
<p> © 2019 W3CodingSchools All rights reserved. </p>
</div>
</body>
</html>
Try it
From the above example we can say that,  for the migration form HTML4 to HTML5 we have to make changes in the following fields:

Change HTML 4 Doctype to HTML 5 Doctype:

This is HTML4 doctype:

Example:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
For the migration from HTML4 to HTML5 change it to:

Example:

<!DOCTYPE html>

Change HTML4 Encoding to HTML5 Encoding:

This is HTML4 encoding:

Example:

<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
Change it to:

Example:

<meta charset="utf-8">

Use the HTML5 Shiv:

Use the HTML5Shiv to style the unknown elements and to support them in the older versions of internet explorer.

Example:

<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<![endif]-->

Change <div> elements to HTML5 Semantic Elements:

In HTML4 we used <div> element for header, footer, menu and article etc, but in HTML5 we used the semantic elements like <header>, <footer>, <article>, <nav> etc.

Example:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title> HTML5</title>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js">
<![endif]-->
<style>
body {
font-family: Arial,sans-serif;
font-size: 1em;
}
header, footer {
padding: 15px;
color: white;
background-color: #ff5722;
}
section {
margin: 6px;
padding: 15px;
background-color: #ff5722;
}
article {
margin: 6px;
padding: 15px;
background-color: white;
}
nav ul {
padding: 0;
}
nav ul li {
display: inline;
margin: 6px;
}
</style>
</head>
<body>
<header>
<h2> Web Technologies </h2>
</header>
<nav>
<ul>
<li> HTML </li>
<li> CSS </li>
<li> Bootstrap </li>
</ul>
</nav>
<section>
<h2> Tutorials </h2>
<article>
<h2> HTML </h2>
<p> HTML is a markup language using which you can create your website. HTML stands for Hypertext Markup Language. It contains elements and the elements are represented by tags. You can create a static webpage by using HTML only. Technically HTML is not a programming language it is a markup language. </p>
</article>
<article>
<h2> CSS </h2>
<p> CSS is the acronym for Cascading Style Sheets. It is widely used language on the web. Styles are set using CSS properties. For example, you can set font properties (size, colors, style etc), background color, border styles, and much more. Which describe the look and formatting of a document written in markup language. External stylesheets are stored in CSS files. </p>
</article>
<article>
<h2> Bootstrap </h2>
<p> Bootstrap is the most popular HTML, CSS, and JavaScript framework for developing responsive and mobile-friendly websites or web applications. It also gives you the ability to create Responsive Web Designs. It is an open-source framework and free to download and use. It is the most popular front-end framework used for faster and easier to develop web applications or websites. </p>
</article>
</section>
<footer>
<p> © 2019 W3CodingSchools All rights reserved. </p>
</footer>
</body>
</html>
Try it

Difference between the <article>, <section> and <div> element:

There is difference between <article> <section> and <div> in the HTML5 standard.
To represent a generic section of the HTML document a <section> element is used. It should not be used for styling or scripting purposes only.
There is a difference between the <article> and the <section> element. The <article> element is used to specify the complete composition in a page, whereas, the <section> element is used to represent a section of a page or document.
To mark the block of the document as a group the <div> element is used. This document is then used to specify the properties of this group. The <div> element does not affect the appearance of the document.
Some different examples of < article>, <section> and <DIV> element:

<article> element within <article> element:

Example:

<article>
<h2>Highlights</h2>
<article>
<h2>Classified</h2>
<p>This section contains classified news.</p>
</article>
<article>
<h2>Sports</h2>
<p>This section contains sport news.</p>
</article>
<article>
<h2>Entertainment</h2>
<p>This section contains entertainment news.</p>
</article>
</article>
Try it

<div> element in <article> element:

Example:

<article>
<h2>Highlights</h2>
<div class="news">
<h2>Classified</h2>
<p>This section contains classified news.</p>
</div>
<div class="news">
<h2>Sports</h2>
<p>This section contains sport news.</p>
</div>
<div class="news">
<h2>Entertainment</h2>
<p>This section contains entertainment news.</p>
</div>
</article>
Try it

<div> element in <section> element in <article> element:

Example:

<header>
<h2> Newspaper </h2>
</header>
<nav>
<ul>
<li> Classified </li>
<li> Sports </li>
<li> Entertainment </li>
</ul>
</nav>
<article>
<section>
<h2> Highlights </h2>
<div class="news">
<h2> Classified </h2>
<p> This section contains Classified news. </p>
</div>
<div class="news">
<h2> Sports </h2>
<p> This section contains sports news. </p>
</div>
<div class="news">
<h2> Entertainment </h2>
<p> This section contains entertainment news. </p>
</div>
</section>
</article>
Try it

Post navigation

Semantic Elements in HTML5
Style Guide

Ask a Question Cancel reply

Your email address will not be published. Required fields are marked *

W3 CODING SCHOOLS © Copyright 2019-20
Privacy policy   Terms of use

We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok