Open In App

HTML File Format | .html Extension

Last Updated : 29 Jan, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

HTML, or Hyper Text Markup Language, is the extension for web pages. It is the most basic file that defines the structure of the web page to be displayed. HTML files can be loaded from local storage or received from the server while browsing.

htm-Web-page-Format

The HTML files are made up of elements like forms, texts, images, animations, etc. These elements are represented in the form of tages. HTML can also be embedded with a scripting language like JavaScript.

HTML File Format Structure

An HTML file is composed of three parts:

  • HTML version information in a line
  • A header section for declarations
  • A body section where the web page information is written
<!DOCTYPE html>    
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>Heading</h1>
<p>paragraph.</p>
</body>
</html>

In the above code example, DOCTYPE HTML defines that this code is of HTML5 version.

Uses of HTML

  • Web Page Development: HTML is used to structure the web page in different ways by creating sections, headings, footers, etc.
  • Navigation: HTML is essential while navigating through web pages. It becomes possible due to the hyperlinking feature of HTML.
  • Data Entry: The Forms feature of HTML paves the way for data collection. The HTML tag <form> is used in this case.
  • Storage function in the browser: LocalStorage and IndexDB are two features to save the data in the browser locally.

How to Run HTML file

There are multiple ways to run HTML files. I will tell you an easier way.

Step 1: Right-click on the HTML file you want to open

Step 2:  Now click on Open With and then choose your browser where you want to open your file.

Screenshot-2023-11-02-223455

Choose your browser to open with

Step 3: Once you choose your browser, the html file will be opened in your browser.

Benefits of HTML web page format

  • HTML allows us to browse the internet with ease; we just need to click on a link, which opens the door to the whole world of the internet.
  • Rich media integration The HTML file format allows us to integrate different kinds of media into our web page, making it more engaging and increasing the user experience.
  • Extensibility: HTML can be extended using various technologies and frameworks, allowing for the development of sophisticated web applications.

Features of HTML web page format

  • Structure: HTML provides a very structured way to organize and present diverse kinds of content on a web page.
  • Hyperlink: HTML enables us to create hyperlinks using the <a> tag which helps in navigating between different web pages easily.
  • Scripting: HTML can be embedded into a scripting language like JavaScript to add interactivity and dynamic behavior to web pages.

Limitations of HTML file

  • It is static, so it alone cannot be used to make dynamic web pages.
  • Making the structure for bigger pages complex due to the syntax
  • We need to write too much code, even for creating a simple page.
  • Security features are limited.

Example of HTML file

HTML




<!DOCTYPE html>
<html>
<head>
    <title>List Example</title>
</head>
<body>
    <h1>Types of Fruits</h1>
    <ul>
        <li>Apples</li>
        <li>Oranges</li>
        <li>Bananas</li>
    </ul>
</body>
</html>


Output:

Screenshot-2023-11-08-163629

Output of the above code



Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads