HTML stands for HyperText Markup Language. It gives a web page its structure and meaning. Which words are a heading? Where does a paragraph start? What does a link point to? HTML marks out those parts so a browser can put the page together.
Wondering “what is HTML?” because you want to make a website? Start with one file. You can open it on your computer and see changes straight away. A plain-text editor and browser are enough; you don’t need hosting or a framework.

What is HTML used for?
Think of a recipe: title, introduction, ingredients and instructions. Without structure, it would all run together. HTML identifies the headings, paragraphs and list items so the browser can present a document rather than one stream of text.
The hypertext part is about links. You can follow one document to another instead of reading everything in a fixed sequence. Look at the early World Wide Web project page preserved at CERN: short descriptions lead you to other documents. There is very little decoration, but the links make the collection useful.
Modern sites use that idea alongside pictures, forms, audio and video. A shopping application may generate HTML from templates and product data. WordPress uses stored content and a theme to help produce a page. The browser still has to interpret the structure it receives.
HTML is a markup language. It describes content rather than providing general-purpose programming instructions such as loops or calculations. That distinction doesn't make it a minor detail. A badly structured form can be awkward to use even when the code handling its submissions works perfectly.
Tags, elements and attributes
A paragraph has an opening tag, a closing tag and the words between them. Together, those pieces make an element. Here is how it looks:
<p>The workshop starts on Monday.</p>
Angle brackets mark out the tags. The closing tag has a slash before its name. Here, p means paragraph. The browser normally shows the sentence without the brackets.
An attribute adds information inside an opening tag. Here, href holds the destination. The words between the tags become the link text. Changing the destination changes where the reader goes; changing the text changes the label.
<a href="workshops.html">See upcoming workshops</a>
Make that label useful. “See upcoming workshops” tells someone where they are going. A page full of “click here” links is harder to scan. The relative path workshops.html points to a file in the same folder as this page.
| Element | Purpose | Example use |
|---|---|---|
| h1 | Main heading | The title of a workshop page |
| p | Paragraph | A short description |
| a | Hyperlink | Visit the booking page |
| ul and li | Unordered list and items | Things to bring |
| img | Image | A photograph of the venue |
| button | Action control | Submit a form |
Not every element has a closing tag. An img element is a void element. Its attributes tell the browser which image to load and supply the text alternative. You don't put a paragraph inside it or add an img closing tag after it.
<img src="workshop-room.jpg" alt="Tables arranged around a pottery wheel">
Choose alt text for the job the image does on the page. A purely decorative picture generally needs an empty alt value. A useful photograph may need a short description. Repeating workshop-room.jpg would tell someone little about what is in the photograph or why it matters here.
Build your first HTML page
Save a new plain-text file as index.html. Copy this complete example into it, save again and open it in your browser. Keep the editor open for changes.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Saturday pottery workshop</title>
</head>
<body>
<main>
<h1>Saturday pottery workshop</h1>
<p>Make a small bowl and learn how to shape clay.</p>
<h2>What to bring</h2>
<ul>
<li>An apron</li>
<li>Comfortable shoes</li>
</ul>
<p>Questions? Email the workshop organiser.</p>
</main>
</body>
</html>
At the top, the short doctype helps the browser use standards mode. The html element contains the document, and lang states its main language. Inside that, head holds document information and body holds the page content. The indentation helps you see how those parts fit together.
The title normally appears in the browser tab. The h1 appears on the page itself. They have matching wording in this example, but they are separate elements. UTF-8 sets the character encoding, and the viewport setting helps mobile browsers use the device width for the layout viewport.
Change the first paragraph, save and refresh. Did your new words appear? If not, check which file you saved and which you opened. You may be editing one copy of index.html while viewing another in a different folder.
Check the extension too. An editor may have saved index.html.txt. If the browser shows the code as text or the file opens elsewhere, make file extensions visible in your file manager and check the actual filename.
A basic editor is enough to get started. For longer files, HTML completion and error highlighting can save some typing and help you spot mistakes. The WebStorm HTML documentation describes those features and its browser preview. They are conveniences, though: you still need to understand what the elements mean.

HTML, CSS and JavaScript
HTML, CSS and JavaScript often appear together, but their jobs differ. Are you changing the content, its appearance or its programmed behaviour?
| Change | Usual tool | Reason |
|---|---|---|
| Add a paragraph or heading | HTML | Defines content and structure |
| Set colours and spacing | CSS | Controls presentation |
| Calculate a result after input | JavaScript | Adds programmed behaviour |
| Provide a labelled text field | HTML | Supplies a native form control |
Some interaction is already built into HTML. Links, form controls and disclosure widgets do not need to be invented from scratch with JavaScript. Use JavaScript when you need additional programmed behaviour. A simple link can work perfectly well on a page that has no script at all.
To load a separate stylesheet, put a link element in the head. Our guide to linking CSS to HTML walks through the paths and common loading problems. Let CSS handle the styling. Choosing a heading only because you want bigger letters makes the document harder to understand.
Images are another useful example of the distinction. HTML identifies the image and provides its text alternative; CSS controls how it is presented. Once your picture loads, try these examples for centering an image. Fix a broken file path first, before spending time adjusting its position.
Meaning and accessibility
Semantic HTML means picking an element for the job it describes. A heading introduces a section. A list groups list items. A button performs an action. A div is a generic container; it doesn't carry those meanings just because you have styled it to look like one of them.
Give a small page a clear main heading, then arrange the subheadings in a sensible order. Avoid skipping levels just to get a different font size. Imagine reading only the headings: would you understand the sections and how they relate? That is a useful check before worrying about colours.
Give each form field a visible label. Match the label’s for value to the input’s id, as shown below. A placeholder isn’t a replacement: it disappears during typing, leaving the reader without that visible reminder.
<label for="visitor-name">Your name</label>
<input id="visitor-name" name="visitor-name" type="text">
This creates a labelled field. It doesn’t store a booking or send an email by itself. Submitting information needs a destination and suitable handling. A form can look finished while having no processing behind it.
Try moving through the page with your keyboard. Can you reach the links and controls? Can you tell what each one does? Meaningful HTML gives assistive technology useful information, but using the right tags isn't a guarantee that every part of a website will be accessible.
Common mistakes and checks
A browser can recover from quite a few markup mistakes. That is helpful for readers, but misleading while you are learning. A page can look reasonable even when its source has a problem. Incorrect nesting may leave the browser building a different document structure from the one you expected.
Reduce the page to the smallest example that still shows the problem. Check closing tags, quotes and paths before adding more code. Indentation helps you follow nesting, but markup defines the relationships, not the spaces at the start of each line.
A checker gives you another view of the problem. The HTMLHint getting-started guide explains how to run configurable markup checks. Depending on the rules, it can flag missing attributes or duplicate identifiers. It won't tell you whether an explanation is useful, or whether an image description actually fits the picture.
Developer tools can help too. The Elements panel shows the current document tree. View Source shows the delivered source. Don't expect them always to match: the browser may have repaired the markup, and JavaScript may have changed the page after it loaded.

Try a small change before moving on
Make the workshop example your own: a walking route, club meeting or recipe. Change the title, heading, introduction and list items. Keeping the structure while changing the content helps you see what each element contributes.
Next, make a second file called details.html in the same folder. Give it a title, heading and paragraph. Add a link from index.html to this new file, and a return link on the second page. Open index.html and follow both links. You now have a tiny website, still stored on your computer.
For one more exercise, move details.html into a folder called pages. Update the first link to pages/details.html. The return link now needs ../index.html to go up a folder. Take your time with this step. Understanding those paths will help you solve many missing-image and broken-link problems later.
Keep content readable without styling
Read the plain page before adding colour or animation. Is the title useful? Do headings introduce the material underneath? Would a list be easier than a dense paragraph? These decisions give you a better starting point for design.
Keep original image files somewhere safe and put suitable web copies in your project. Check the spelling and letter case of the filenames in your markup. A path that works on a case-insensitive computer can fail on a server that treats uppercase and lowercase letters as different characters.
Resize the browser after substantial changes. Watch for words, pictures or tables that don’t fit. HTML supplies the structure; your eventual CSS should help the content fit the space. Catching problems now is easier than fixing several pages later.
Frequently asked questions
Is HTML the same as HTML5?
HTML5 is a familiar name for modern HTML. The WHATWG maintains HTML as a Living Standard today. For a new page, use the short doctype in this example. You don't need to find an old version-specific declaration before you can start writing.
Can I build a website with HTML alone?
Yes. You can make linked documents containing text, images and native controls. CSS gives you more control over their appearance. To let other people visit them, you need hosting or another web server. Opening index.html on your own computer doesn't publish it.
How long does it take to learn HTML?
You can make a small page in one session. Forms, tables, accessibility and larger documents take practice. Try building two linked pages next.
Check your understanding
Which element puts the page title in the browser tab?
The title element belongs in the head and supplies the tab title. The h1 is the main heading in the page content.
Does saving index.html publish it on the web?
No. Saving makes a local file. Publishing means making it available through hosting or another web server.
Should you use a heading just to make text bigger?
No. Choose a heading for its role in the document, then use CSS to set its appearance.