← Dashboard

web development / frontend

Learn Frontend Development for Free: HTML, CSS and JavaScript in the Order That Works

Frontend is three languages that each do one job. This guide shows what each does, builds a responsive card layout in 20 lines of HTML and CSS that was tested at three screen widths, and points to the lessons on MDN, The Odin Project and web.dev worth doing first.

updated Nov 2026·a 12-minute read·layout tested at 375, 700 and 1000 px

Searching "learn frontend development" returns a hundred roadmaps that all say HTML, then CSS, then JavaScript, then a framework. That order is right, but it hides where beginners lose weeks: they treat the three as separate subjects instead of three parts of one pipeline, and they start a framework before they can build a plain page that works on a phone.

This page keeps the order and fills in what each step is for. It includes one layout you can paste and run, one JavaScript mistake that catches almost everyone using fetch, and a short accessibility check you can do without special tools.

01 · THREE LANGUAGES, THREE JOBS

What the browser does with each file

HTML, CSS and JavaScript compared
LanguageJobHow you know you have learned it
HTMLDescribes what things are: headings, lists, links, forms, buttonsYou pick the right element before you reach for a div
CSSDescribes how things look and where they sitYou can lay out a page without trial and error
JavaScriptChanges the page and talks to servers after it loadsYou can fetch data and update the page when it fails

MDN's Learn web development section teaches these in that order, with exercises. Start with the structuring-content lesson, then styling basics, then scripting. The Odin Project's Foundations course covers the same ground as a project-based curriculum, and many people use it as the structure while using MDN as the reference.

02 · HTML FIRST

Semantic elements are the cheapest accessibility win

A page built from div elements looks fine and works for no one who is not looking at it. Screen readers, search engines and keyboards all depend on elements that carry meaning. Use nav for navigation, main for the primary content, button for actions and a for links. Give every page one h1 and nest headings in order.

Pick the element that says what it is
You want...UseNot
A clickable action<button><div onclick>
A link to another page<a href><span> with a click handler
A list of cards<ul> and <li>A stack of <div> elements
A form field with a label<label for> and <input>Placeholder text as the label
TIPUse the keyboard as a test. Press Tab through your page. If you cannot reach or operate something, a screen reader user cannot either. Fix it in the HTML, not with ARIA attributes added later.

03 · CSS LAYOUT

A responsive card grid with no media queries

Layout is where CSS stops being decoration. Grid with auto-fit and minmax() builds a layout that adapts to any width on its own. Here is the markup and the style. The page also needs a viewport meta tag in the head, <meta name="viewport" content="width=device-width, initial-scale=1">, or phones will render it at desktop width.

index.htmlmarkup
<ul class="cards">
  <li class="card"><h2>Ridge loop</h2><p>Six miles, steady climb.</p></li>
  <li class="card"><h2>River path</h2><p>Flat and shaded.</p></li>
  <li class="card"><h2>Summit spur</h2><p>Steep final mile.</p></li>
</ul>
styles.csslayout
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
  padding: 0;
  list-style: none;
}
.card {
  border: 1px solid #767676;
  border-radius: 0.5rem;
  padding: 1rem;
}

This was loaded in Chromium at three widths. At 375 px it showed one column, at 700 px two and at 1000 px three, with no horizontal scrolling at any of them. The rule is: columns must be at least 16rem wide (256 px), and any leftover space is shared equally. Change 16rem to 10rem and you will see four or five columns appear on a wide screen.

The border color matters too. #767676 on white has a contrast ratio of 4.54, just above the 4.5:1 that WCAG level AA requires for normal text, according to the WebAIM contrast checker. #777777 is 4.48 and fails. Borders are not text, but the same tool is how you check your text colors.

04 · JAVASCRIPT

The fetch mistake nearly everyone makes

JavaScript gets interesting when the page talks to a server. The fetch function is the standard way, and it has a trap: it only rejects its promise when the network fails. A 404 or 500 response still resolves normally, with res.ok set to false. If you skip that check, your page tries to render an error response as data.

load-trails.jsfetch
async function loadTrails() {
  const res = await fetch('/api/trails');
  // fetch only rejects on network failure; a 404 or 500 still resolves
  if (!res.ok) throw new Error('Request failed with status ' + res.status);
  return res.json();
}

javascript.info explains promises and fetch from scratch, and it is the best free resource for understanding why the code above is written with async and await. If a browser blocks your request across origins, the cause is usually CORS, which is configured on the server and not in your frontend code.

05 · CHECK YOUR WORK

Three checks before you call a page finished

  1. Resize. Drag the browser narrower than a phone. Nothing should scroll sideways.
  2. Tab through it. Every control reachable, with a visible focus outline.
  3. Check color contrast on text with the WebAIM tool: 4.5:1 for normal text and 3:1 for large text.

web.dev offers free Learn courses on CSS, responsive design, accessibility and performance, and they are worth taking after your first project because you will have real problems to apply them to.

06 · FREE RESOURCES

The lessons to do, with links

07 · FAQ

Frequently asked questions

How long does it take to learn frontend development?

Comfortable HTML and CSS take a few weeks of steady study, and working JavaScript takes a few months. The time depends heavily on how many hours a week you study and how much you build.

Should I learn a framework right away?

No. Build two or three pages with plain HTML, CSS and JavaScript first, including one that fetches data. A framework makes much more sense once you have felt the problems it solves.

Is The Odin Project free?

Yes. The Odin Project is a curriculum you can follow for free, and its Foundations course covers HTML, CSS and JavaScript. MDN's Learn web development section is also free.

Why does fetch not throw an error on a 404?

The fetch function only rejects when the request cannot complete, such as a network failure. A 404 or 500 response still resolves, so you must check the response's ok property or status code yourself.

What is the minimum color contrast for text?

WCAG level AA requires a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text, according to the WebAIM contrast checker.

Keep going

Pick a framework and go deeper.