How HTML works

Suneet Negi
2 min readJan 15, 2023

--

HTML (Hypertext Markup Language) is the standard language used to create web pages. It is a markup language, which means that it uses a set of tags and attributes to structure and format the content of a web page.

HTML documents are made up of elements, which are represented by tags. These tags are enclosed in angle brackets, and typically come in pairs, with an opening tag and a closing tag. For example, the paragraph element is represented by the <p> tag, and the text inside the paragraph would be enclosed between the opening <p> tag and the closing </p> tag.

HTML tags can also have attributes, which provide additional information about the element they are associated with. For example, the <img> tag, which is used to embed images on a web page, has the “src” attribute, which specifies the source of the image file.

HTML also uses a hierarchical structure, with elements nested inside other elements to create the layout and organization of the content on a web page. For example, a webpage is typically divided into a header, main content, and footer, which are represented by <header>, <main> and <footer> tags respectively.

To create an HTML document, you need a text editor, like Notepad or Sublime, to write the HTML code, and a web browser, like Chrome or Firefox, to view the resulting web page.

When a web browser requests an HTML document from a web server, the server sends back the HTML code, which the browser then renders into a visual web page. The browser reads the HTML code and interprets the tags and attributes to determine how the content should be displayed. CSS (Cascading Style Sheets) and JavaScript can also be used to further style and add interactivity to the web page.

In summary, HTML provides the structure, layout and organization of web pages and it is read by web browsers and rendered as visual web pages.

--

--

Suneet Negi
0 Followers

I am a curious and passionate writer with a love for exploring new ideas and perspectives. Join me on my journey as I share my thoughts and insights on Medium.