Skip to Content
HTML and CSS for Beginners: Build a Page That Looks Right in the Browser
Beginner
0 likes
Courses
HTML and CSS for Beginners: Build a Page That Looks Right in the Browser

What HTML and CSS Actually Do in Your Browser

What HTML and CSS are for, how they differ from JavaScript, and what a browser does with a file you save. After this, you'll know which language fixes content and which fixes look.

Course content

Sign in to save your progress.

Course Home

Skip ahead: If you already know HTML is structure, CSS is look, and the browser builds a page from both, skip to "What they can't do", then go to the next lesson.

HTML is the content and structure of a web page. CSS is how that content looks. A browser reads both and draws what you see. That is the whole job for this course.

You do not need a framework, a build tool or a paid editor to start. A text editor and a browser are enough. If you skip that and paste a finished template first, you will not know which part to change when something looks wrong.

Two languages, two jobs

Mix them up and nothing you read online will make sense.

  • HTML puts things on the page: headings, paragraphs, links, images, forms.
  • CSS decides how those things look: colours, spacing, fonts, layout.

Example. A "Contact us" heading. HTML makes it a heading. CSS makes it blue and 32 pixels tall. Change the CSS and the words stay the same. Change the HTML and the style still applies if the tag or class matches.

JavaScript is a third language. It makes the page react after it loads: clicks, typing, calculations. This course does not cover it. JavaScript for Beginners starts there when you are ready.

What the browser does with your files

You save index.html. You open it in Chrome or Edge. The browser:

  1. Reads the HTML from top to bottom.
  2. Builds a tree of elements (the DOM).
  3. Applies CSS rules that match those elements.
  4. Paints the result on the screen.

If the HTML is wrong, the tree is wrong. If the CSS is wrong, the tree is fine but it looks wrong. Knowing which file to open first saves hours.

A tiny page, no style yet

Here is a complete HTML page. Don't worry about every word yet. The next lesson gets you opening it.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Store hours</title>
</head>
<body>
  <h1>Store hours</h1>
  <p>Open Monday to Saturday, 9am to 6pm.</p>
</body>
</html>

Save that as index.html, open it, and you should see a heading and a paragraph. Default browser font. Default margins. Ugly is fine. It proves the pipeline works.

What they can't do

HTML and CSS are not a database, a login system or a payment processor. They describe and style a page. If you need data to save when the visitor leaves, you need a server and usually another language. If you need the page to recalculate a total when quantity changes, you need JavaScript.

⚠ Warning: Don't put a password, API key or private list of customers into an HTML file you publish. Anyone can View Source and read it. Public content only.

Common mistakes when starting

  • Learning a page builder first. Builders hide the HTML. When something breaks, you have nothing to inspect.
  • Putting all CSS inline on every tag. It works once. Changing the brand colour later means editing twenty places.
  • Skipping the browser's Inspect tool. The browser will show you which CSS rule won. Beginners often never open it.

💡 Tip: Use one browser for this course, preferably Chrome or Edge. The DevTools steps match them. Firefox and Safari work, but the menus sit in different places.

What happens if you skip this

You can jump straight into tags. Plenty of people do. But if you don't know whether a colour problem is HTML or CSS, you will edit the wrong file and wonder why nothing changes.

So, a quick test before the next lesson. On the last website you used, pick one thing that is content (a heading, a price) and one thing that is only look (a colour, a font). Which file would you open first to change each?

About

What HTML and CSS are for, how they differ from JavaScript, and what a browser does with a file you save. After this, you'll know which language fixes content and which fixes look.

Duration
5 min
Last update
08/20/2026
Was this helpful?
​ 0 ​ 0

Comments (0)

Sign in to comment

No comments yet.