Skip to main content

What is HTML and what is it used for?

HTML (HyperText Markup Language) is a markup language used to create and structure web pages.

It is not a programming language; it exists so that the browser understands what and how to display to the user: text, images, links, tables, forms and other elements.


Main functions of HTML:

  1. Structuring content - HTML defines where the headings, paragraphs, lists, images and so on are on the page. For example: <h1> is a heading, <p> is a paragraph, <img> is an image.
  2. Creating links between pages - the <a> tag connects documents across the network (hence the word HyperText).
  3. Embedding media - HTML lets you insert audio, video, images and interactive elements.
  4. Working together with CSS and JavaScript:
  • CSS handles presentation (colors, fonts, sizes).
  • JavaScript handles interactivity and dynamics.
  • And HTML handles structure, the site's "skeleton".

Example of the simplest HTML page:

html
<!DOCTYPE html> <html> <head> <title>My first site</title> </head> <body> <h1>Hello, world!</h1> <p>This is my first HTML web page.</p> </body> </html>

Summary: HTML is the foundation of any website, the "skeleton" onto which style (CSS) and logic (JavaScript) are layered. Without HTML, a web page simply cannot exist.

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.