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.
-
Before You Write Markup
-
What HTML and CSS Actually Do in Your Browser
-
Your First Page: Save It, Open It, See It Break
-
-
-
HTML You Cannot Skip
-
Tags, Elements and Attributes Without the Fog
-
Headings, Paragraphs, Links and Images That Mean Something
-
Semantic HTML: Stop Wrapping Everything in a Div
-
-
-
Structure That Helps the Reader
-
Lists and Tables When You Actually Need Them
-
Forms That Submit Without Confusing the User
-
-
-
CSS Basics You Cannot Skip
-
Selectors, Classes and Why Inline Styles Bite You Later
-
The Box Model: Margin, Border, Padding, Content
-
Colors, Fonts and Units That Don't Fight You
-
-
-
Making It Look Like a Real Page
-
Cascade and Specificity Without Guessing
-
Inspect and Fix Styles in Browser DevTools
-
-
- Final Check: HTML and CSS for Beginners
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:
- Reads the HTML from top to bottom.
- Builds a tree of elements (the DOM).
- Applies CSS rules that match those elements.
- 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
Comments (0)
Sign in to commentNo comments yet.