HTML BoilerPlate

dheeraj korangadheeraj koranga
2 min read

The HTML boilerplate is the basic structure of an HTML document that includes the essential tags and elements needed to create a well-formed HTML page. It's the foundation or starting template for any HTML document.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Your Page Title</title>
    <!-- Link to external CSS or other resources can go here -->
</head>
<body>
    <!-- Content of the webpage goes here -->
</body>
</html>
  1. <!DOCTYPE html>:
    It declares the document type and version of HTML (HTML5 in this case).

    It ensures that the browsers render the page correctly.

  2. <html lang="en">:
    The root element of the document.

    The lang attribute specifies the language of the document (en stands for English).

  3. <head>:
    The head contains metadata (information about the document) like the character set, viewport settings, and the title.

    It also links files such as CSS, JavaScript, or other resources.

  4. <meta charset="UTF-8">:

    Defines the character encoding for the document (UTF-8 is standard for most languages).

  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">:

    Ensures that the page is responsive and scales properly on different devices like mobile phones or tablets.

  6. <meta http-equiv="X-UA-Compatible" content="IE=edge">:

    Ensures the page is displayed in the latest supported version of Internet Explorer.

  7. <title>Your Page Title</title>:

    Sets the title of the webpage, which appears on the browser tab.

  8. <body>:

    Contains all the visible content of the page like text, images, links, etc.

Examples :

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Html boiler plate</title>
    <!-- Link to external CSS or other resources can go here -->
</head>
<body>
    <h1>Example using Boiler Plate</h1>
    <p>Lorem ipsum dolor sit, amet consectetur..</p>
</html>

0
Subscribe to my newsletter

Read articles from dheeraj koranga directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

dheeraj koranga
dheeraj koranga