Dev Practical

Learn HTML with Examples


  1. What is HTML?
  2. How HTML works: Introduction to HTML
  3. Tools for writing HTML
  4. Basic html elements and tags tutorial
    - Basic HTML Template - Headings - Paragraphs
  5. Other text formating using HTML
  6. Creating sections using Div
  7. Creating sections using HTML5 Semantic tags
    - Header - Aside - footer
  8. Intermediate html tags [tutorial]
    - Ordered list - Unordered list - Code - Pre - Forms - Html Input - Text Input - Radio input - Submit button - Blockquotes - Video - Audio - Embed - Canvas

What is html?

HTML is the short form for Hyper Text Markup Language. It helps us to display text, links, pictures, sounds and videos correctly on a webpage. Every time you visit a website through you should know that HTML is involved.

HTML was created by Tim Berners-Lee to share documents across the internet. It has evolved. You can now be able to share images, videos, and even play games on the internet.

How HTML works: Introduction to HTML.

HTML is used to describe the appearance of a document to be displayed by a internet browser.

HTML documents are normal text documents but with ‘.html‘ file name extension. Normal text files have a ‘.txt‘ file name extension.

When the HTML file is viewed on a browser, the browser interprets the HTML code is but does not display the html code itself.

To view the html code itself, you can right click on the webpage and click on view source.

To edit the HTML, you need to use a text editor.

HTML Text Editors

HTML text editors allow you to create and edit HTML files. There are many text editors you can use. Some of them are:

      1. Sublime text editor of my choice. Their upgrade notification might annoy you.
      2. Notepad++ (for windows only).
      3. Atom (for windows and Ubuntu).
      4. Visual Studio Code (for windows and Ubuntu).
  • You can read more about html text editors.

    Html elements

    Html element includes the opening tag, the closing tag and the content between the tags.

    Html tags

    These are tags used to tell the browser the beginning and the end of a HTML element.

    Basic html elements and tags tutorial

    1. Basic html page

    Each HTML page contains a template that is always present in any HTML page. Further more, the tags used in the template help divide your html into meaningful sections.

    Each HTML page usually has the following tags:


    <!DOCTYPE html>
    <title>This is a title</title>
    This is a basic HTML page.


    This is a basic HTML page.

    Anything that you want to be displayed on the HTML page is added between the body tags.

    <iframe width=”500″  height=”300″ src=””> </iframe>

    HTML Text Tags

    1. Headings: Creating Headings using HTML

    There are 6 type of heading with h1 being used as the title of the post or article for SEO purposes.

    The rest can be used for headings and sub headings.

    <h1>H1 Heading1</h1>
    <h2>H2 Heading2</h2>
    <h3>H3 Heading3</h3>
    <h4>H4 Heading4</h4>
    <h5>H4 Heading5</h5>
    <h6>H6 Heading6</h6>

    H1 Heading1

    H2 Heading2

    H3 Heading3

    H4 Heading4

    H4 Heading5
    H6 Heading6


    2. Paragraphs

    This is used to display the normal text in paragraphs like the normal paragraph.

    <p>This is a paragraph.</p>
    <p>This is a second paragraph.</p>

    This is a paragraph.

    This is a second paragraph.

    3. Line Break

    The line break tag
    breaks a line of text wherever it is inserted.

    The line break will be here
    , and not here on a full line of text.

    The line break will be here
    , and not here on a full line of text.

    4. Bold & Strong

    Both turns the text into bold but strong is concidered to have more meaning to search engines.

    Bolded text

    5. Italic & Emphasized

    Both turns the text into italics but strong is concidered to have more meaning to search engines.

    Italized text

    Emphasised text

    6. Underlined

    Use this carefully so that the users don’t confuse them with links.

    Underlined text

    7. Ordered Lists

    <li>Item 1</li>
    <li>Item 2</li>
    <li>Item 3</li>
        1. Item 1
        2. Item 2
        3. Item 3

    8. Unordered Lists

    <li>Item 1</li>
    <li>Item 2</li>
    <li>Item 3</li>
        • Item 1
        • Item 2
        • Item 3
    1. Superscript
    The word <sup>tags</sup> is superscript.
    The word tags is superscript.
    1. Subscript
    The word <sup>tags</sup> is a subscript.
    The word tags is a subscript.
    1. Horizontal Line

    Create a line that breaks the text.

    1. Marked or Highlighted Text

    2. Deleted (Cross-Through) Text


    1. Short & Long Quotations
    All of this text will be in a blockquote like the rest of the examples.

    I’m quoting this story.

    1. Italics

    The dog ate my homework is a commonly used lie.

    1. Images

    <img src="" alt="image of a two cute dogs">

    image of a two cute dogs

    Links help you navigate from one page to the next web page or a different website.

    The tag used to make links are the <a href=”URL”></a> tags.

    The URL is the target, which page or website you want to go to.

    Relative path


    <a href=”/projects”>this is a relative link</a>

    this is a relative link

    Absolute path


    <a href=””>this is an absolute link</a>


    this is an absolute link

    Html comment tag

    Html comment tags are used to add a comment in a html document. Anything inside the comment tag is not rendered on the browser but can be seen if you check the html source code.


    <!– This is a comment that will not be visible –>


    Html structure tags & elements







    Intermediate html tags






    <input type="">

    Html input types

    Text Inputs

    <form action="contacts.php">
    <input type="text" name="firstname" placeholder="First Name">

    Radio input

    <form action="contacts.php">
    <input type="radio" name="firstname" placeholder="First Name">
    <input type="radio" name="firstname" placeholder="First Name">

    Submit button

    <form action="contacts.php">
    <input type="submit" value="Submit">


    <form action="contacts.php">
    <button type="submit">Submit</button>

    You can read an in-depth article on HTML forms that I wrote.


    Inline quotes

    <p>When Dave asks HAL to open the pod bay door, HAL answers: <q cite="">I'm sorry, Dave. I'm afraid I can't do that.</q></p>


    <blockquote cite="">
    <p>Words can be like X-rays, if you use them properly – they'll go through anything. You read and you're pierced.</p>
    <cite>– Aldous Huxley, Brave New World</cite>


    <video width="320" height="240" controls>
      <source src="movie.mp4" type="video/mp4">
      <source src="movie.ogg" type="video/ogg">
      Your browser does not support the video tag.


    <audio controls>
    <source src="horse.ogg" type="audio/ogg">
    <source src="horse.mp3" type="audio/mpeg">
    Your browser does not support the audio element.


    <iframe width="420" height="315"



    <canvas id="myCanvas" width="200" height="100" style="border:1px solid #000000;">