HTML gives a web page its structure — headings, paragraphs, lists, links, images. CSS decides how that structure looks — type, colour, spacing, layout. A week is enough to read any page on the web and change it with some confidence, and that is the part that still pays off when something else types the first draft.

First published in 2017 and rewritten in October 2026, with every version and browser-support claim re-checked on the day.

What does HTML actually do?

HTML is HyperText Markup Language. Hypertext is the linking — clicking from page to page. Markup is the labelling: you wrap a piece of content in a tag that says what it is, and the browser decides what to do with it.

Most tags come in pairs — <p> opens a paragraph, </p> closes it — and a few, like <img>, do not. An HTML file needs only a text editor and a .html extension.

The shift since the early days is that the tag describes meaning, not appearance. <h1> means "this is the main heading", not "make this big"; <nav> means "this is navigation". Screen readers, search engines and AI answer engines all read that structure to work out what a page is, so good markup gives you accessibility and SEO largely for free, and bad markup is not rescued by any amount of CSS. More on that in web design best practice.

One thing worth unlearning if you read about HTML a few years ago: HTML has no version numbers any more. There is no HTML 6 coming, and "HTML 5.2" — the last numbered version, from 2017 — has been superseded by a continuously updated specification. It is published by the WHATWG as the HTML Living Standard, and the day this post was rewritten it was marked "Last Updated 22 October 2026". Features are added and refined in place. If you want to learn it properly rather than from whatever a search engine surfaced, our HTML and CSS course starts from the markup and works up.

What does CSS actually do?

CSS is Cascading Style Sheets. You write rules that select parts of the page and set properties on them: a property is what you are changing, like font-family, and the value is what you change it to.

The cascading part confuses people longest. Several rules can apply to one element, so the browser decides which wins on origin, specificity and source order — where the rule came from, how precisely it targets the element, and which came last. Browsers apply their own default stylesheet first, which is why an unstyled link is blue and underlined.

Three ways to attach CSS to a page

Method How it looks When to use it
External stylesheet A separate .css file pulled in with <link> Almost always — one file styles the site and the browser caches it.
Internal stylesheet A <style> block in the page's <head> A one-off page, or critical CSS you want to arrive with the HTML.
Inline styles A style attribute on a single element Rarely by hand; common in HTML email and generated output.

Inline styles are hard to override and impossible to reuse, so they are the first thing to clean up in inherited code.

What has changed since this post was first written?

Quite a lot, and almost all of it removes a workaround. Support is now measured with Baseline: a feature is "newly available" once it works in current versions of the major browser engines, and "widely available" two and a half years later, once older devices have caught up. MDN prints that status on every reference page.

Everything in this table was checked on MDN on 24 October 2026 and is Baseline widely available:

Feature What it replaces Available across browsers since
@layer Specificity wars and !important March 2022
<dialog> Hand-built modal markup and focus trapping March 2022
Container queries (@container) Media queries used as a proxy for component width February 2023
subgrid Nested grids that would not line up September 2023
:has() A JavaScript class toggle to style a parent December 2023
CSS nesting (&) Sass, for a lot of everyday work December 2023
text-wrap: balance Manual line breaks in headings March 2024

So a modern stylesheet is shorter than a 2017 one doing the same job, and a fair amount of advice online solves problems that no longer exist. Check the date on any tutorial before following it.

Do you still need to learn HTML and CSS if AI writes the code?

Yes, but the reason has changed. You are less likely to be paid to type a layout from nothing and far more likely to be handed markup — by a generator, a page builder, a theme or a colleague — and asked whether it is any good. Where generated front-end code tends to fall down:

  • Semantics. It reaches for <div> where <button>, <nav> or <h2> was right, which costs accessibility and SEO.
  • Accessibility. Alt text written for the robot rather than the reader; keyboard and focus behaviour an afterthought.
  • The cascade. Specificity conflicts patched with !important rather than understood.
  • Currency. Older training data reproduces older patterns — floats and breakpoints where a grid and a container query now do the job.

None of that is fatal, and all of it is obvious in seconds if you can read the markup — invisible if you cannot. That is the skill worth having: enough to review and correct, not enough to start from a blank file.

What to learn first

In this order:

  1. The document skeleton: <html>, <head>, <body>, and why <title> and <meta> matter.
  2. The dozen tags that cover most content — headings, paragraphs, lists, links, images, tables.
  3. Selectors, and where padding, border and margin sit in the box model.
  4. Flexbox for rows and columns, then Grid for two-dimensional layout.
  5. Custom properties and @layer, so your stylesheet stays readable.
  6. Your browser's developer tools — inspecting a real page teaches more than any tutorial.

Typography and colour come next — see typography best practices — and if you are learning this with a job in mind, starting a career in web design covers what employers ask for.

Questions people ask

Is HTML a programming language? No, and it is not a weakness. HTML is a markup language: it labels content rather than making decisions. There are no variables, loops or conditions. That is why it is a reasonable first thing to learn — you see a result in the browser immediately, with nothing to debug but your own typing.

Can I learn HTML and CSS without learning JavaScript? Yes, and plenty of people stop there productively. HTML and CSS are enough to build and maintain a site, work confidently in a CMS or page builder, fix a broken email template, or brief a developer precisely. JavaScript becomes necessary when a page needs to react to something, and much of what used to need it — modals, accordions, parent styling — is now in CSS and HTML.

How long does it take to learn HTML and CSS? A day or two to read and edit existing pages with care. A couple of focused days to build a simple responsive page from scratch. Fluency with layout, the cascade and accessibility is a matter of months of real work, not a course length — which is why most people are better served by a short course followed by a live project than by a long course alone.

Do I need HTML and CSS to use WordPress or a page builder? Not to publish, but it changes what you can fix. When a theme does something you did not ask for, the difference between filing a support ticket and editing one line is whether you can read the page.

Is CSS still worth learning when frameworks exist? Yes. Tailwind, Bootstrap and the rest are CSS with conventions on top, and the cascade, specificity and box model still decide what you see. People struggling with a framework are usually struggling with the CSS underneath.

Where to go next

Open any page in your browser, press F12 and change something. Nothing breaks, nothing is saved, and the page stops being abstract within ten minutes. For the whole picture in order rather than in fragments, we run HTML and CSS as classroom and live-online training.