Skip to the content.

HTML Learning Kit

Click ★ if you like the project. Your contributions are heartily ♡ welcome.


SHORT NOTES is provided in this LINK

HTML5 Features

1. Semantics tags

  1. <header>: Represents the introductory contents or a section for the site’s title, logo, navigation links or menu, etc.
  2. <nav>: Used for the navigation section containing links to other pages or parts of the website.
  3. <section>: Represents a standalone section of content, typically with a heading.
    • Example ```html

      About Us

      Information about our company.

      ```
  4. <article>: Represents self-contained content that can be independently distributable or reusable.
    • Example ```html

      Blog Post Title

      Blog post content goes here.

      Published on June 1, 2023
      ```
  5. <aside>: Used for content related to the surrounding content (like sidebars).
  6. <footer>: Defines the footer section for a document or section.
    • Example ```html

      © 2023 My Website. All rights reserved.

      ```
  7. <main>: Represents the main content of the body, excluding headers, footers, and sidebars.
    • Example ```html

      Article Title

      Article content goes here.

      ```
  8. <figure> and <figcaption>: Use a <figure> element to mark up a photo in a document, and a <figcaption> element to define a caption for the photo:
    • Example ```html
      Trulli
      Fig.1 - Trulli, Puglia, Italy.
      ```

2. Form Inputs and attributes

  1. Input types: new input types that provide better input validation and user experience.
    • Example ```html ```
  2. placeholder: The placeholder attribute allows you to provide hints or example values within input fields. It disappears when the user starts typing.
    • Example ```html ```
  3. required: The required attribute specifies that an input field must be filled out before submitting the form.
    • Example ```html ```
  4. pattern: The pattern attribute allows you to specify a regular expression pattern that the input value must match.
    • Example ```html ```
  5. autocomplete: The autocomplete attribute specifies whether a form field should have autocomplete functionality enabled or disabled.
    • Example ```html ```

3. Multimedia Support:

  1. <audio>: Embeds an audio file on a web page.
    • Example ```html ```
  2. <video>: Embeds a video file on a web page.
    • Example ```html ```
  3. <source>: Specifies alternative media resources for <audio> and <video> elements.
    • Example ```html ```
  4. <track>: Specifies timed text tracks, such as captions or subtitles, for <video> and <audio> elements.
    • Example ```html ```
  5. <embed>: Embeds external content, such as plugins or multimedia content, within an HTML document.
    • Example ```html ```

4. HTML5 Api’s

  1. Geolocation API: Retrieves the geographical location of the user.
    • Example ```javascript navigator.geolocation.getCurrentPosition(function(position) { console.log("Latitude: " + position.coords.latitude); console.log("Longitude: " + position.coords.longitude); }); ```
  2. Web Storage API: Stores data on the client side.
    • Local Storage: Persistent storage until manually cleared.
      Example ```javascript localStorage.setItem('key', 'value'); let data = localStorage.getItem('key'); ```
    • Session Storage: Data stored only for the session.
      Example ```javascript sessionStorage.setItem('key', 'value'); ```
  3. Web Workers: Runs JavaScript in background threads, helping to offload tasks.
    • Example ```javascript let worker = new Worker('worker.js'); worker.postMessage('Hello'); ```
  4. Drag and Drop API: Enables dragging and dropping of elements.
    • Example ```html
      Drag me
      ```
  5. History API: Manipulates browser history.
    • Example ```javascript history.pushState({ page: 1 }, "title 1", "?page=1"); ```

5. Canvas and SVG for Graphics

HTML Document Structure

1. HTML Document Structure Basics

2. DOCTYPE Declaration

   <!DOCTYPE html>

3. HTML Root Element

   <html lang="en">
       <!-- The rest of the document goes here -->
   </html>

4. Head Section

5. Body Section

   <body>
       <!-- Visible content goes here -->
   </body>

6. HTML Document Structure Example

   <!DOCTYPE html>
   <html lang="en">
   <head>
       <meta charset="UTF-8">
       <meta name="viewport" content="width=device-width, initial-scale=1.0">
       <title>Basic HTML Document Structure</title>
       <link rel="stylesheet" href="styles.css">
       <script src="script.js" defer></script>
   </head>
   <body>
       <h1>Welcome to My Website</h1>
       <p>This is a sample HTML document structure.</p>
   </body>
   </html>

7. Best Practices for HTML Document Structure

8. Key Elements to Know

SEO using HTML tags