Find a course
Age level: Adults & professionals (18+)BeginnerTechnology & Programming

HTML and CSS Basics

Build and style a real web page from scratch, from first tag to responsive layout

⏱ 2 h 5 min5 modules · 12 lessons70 practice questionsFinal exam: 20 questions
Included with this course

Your certificate for this course

Finish the 12 lessons (about 2 h 5 min) and pass the 20-question final exam. Your Certificate of Completion is ready the moment you pass.

  • Your name and this course titlePrinted in classic diploma typography
  • Grade: Pass, Merit or DistinctionOn the gold seal, with your final score
  • Unique ID and QR codeAnyone can verify it in seconds
  • Score report PDFModule-by-module results and exam score
  1. Lessons12 lessons
  2. Final exam20 questions · 70% to pass
  3. CertificatePDF + score report

What you will learn

  • Explain how browsers, servers, HTML, CSS and JavaScript work together to display a web page
  • Write a valid HTML document with correct structure, nesting, attributes and metadata
  • Mark up text, links, lists, images, tables and forms using accessible, semantic HTML
  • Write CSS rules with type, class, ID and descendant selectors, and predict results using the cascade and specificity
  • Use colors, units such as rem and percentages, and font settings to create readable typography
  • Control spacing and sizing with the box model, box-sizing and display values
  • Build one-dimensional layouts with Flexbox and two-dimensional layouts with CSS Grid
  • Make pages responsive with the viewport meta tag, fluid images and mobile-first media queries, and publish them online

About this course

Every website you have ever visited, from a one-page portfolio to a giant online store, is built on two languages. HTML describes what is on the page: headings, paragraphs, images, links and forms. CSS describes how it looks: colors, fonts, spacing and layout. Learn these two, and you can read the source of any web page and build your own from a blank file.

This free course takes you from zero to a complete, responsive page. You'll start with how the web works: what a browser does with an HTML file and how a page travels from a server to your screen. Then you'll write real HTML, including document structure, headings, links, lists, images, tables and forms, and learn to use semantic elements that make pages accessible to screen readers and understandable to search engines.

In the CSS half, you'll write selectors, understand the cascade and specificity (the rules that decide which style wins), work with colors, units and fonts, and master the box model, the key to controlling space on a page. You'll build layouts with Flexbox and CSS Grid, then make everything adapt to phones, tablets and desktops with media queries and a mobile-first approach. The last lesson walks through checking, organizing and publishing a page for free.

The course is for complete beginners: career changers, designers who want to understand code, marketers and small business owners who edit their own sites, and anyone curious about how web pages work. You don't need to install anything; any text editor and browser will do, and a few short coding exercises run right in the page. Each lesson mixes clear explanations and real code examples with spot-the-bug puzzles, calculators and quick checks, and you can earn a free certificate by passing the final exam.

Syllabus

  1. How Web Pages Work

    See what happens between typing an address and seeing a page, and write your first complete, valid HTML document.

    1. How Websites Work10 min
    2. HTML Document Structure12 min
  2. Writing HTML Content

    Mark up text, links, lists, images, tables and forms, and use semantic elements so every visitor and search engine understands your page.

    1. Text, Headings, Lists and Links12 min
    2. Images, Media and Tables11 min
    3. Forms and Semantic HTML12 min
  3. CSS Fundamentals

    Write CSS rules, target elements with selectors, understand which styles win, and control color, type, sizing and spacing.

    1. CSS Syntax, Selectors and the Cascade12 min
    2. Colors, Units and Typography11 min
    3. The Box Model12 min
  4. Page Layout with Flexbox and Grid

    Arrange elements in rows, columns and full page layouts using the two modern CSS layout systems.

    1. Flexbox Layouts12 min
    2. CSS Grid Layouts12 min
  5. Responsive Design and Publishing

    Make pages work on every screen size, then check, organize and publish your site for the world to see.

    1. Responsive Design12 min
    2. Building and Publishing Your Page12 min
  6. Final exam and certificate

    20 questions drawn from a pool of 32. Score 70% or more to pass; retakes get a fresh set of questions.

Try a sample question

A visitor goes to https://bakery.example/menu/. Which file will the server usually send?

  1. menu.css
  2. menu/index.html
  3. home.html
  4. bakery.html
Show the answer

Answer: B. menu/index.html

When a URL path ends with a folder, web servers by convention send that folder's index.html file. That's why home pages and section pages are usually named index.html. CSS files are requested separately, after the HTML is read.

HTML
HyperText Markup Language: the language that describes the structure and content of web pages.
CSS
Cascading Style Sheets: the language that controls how HTML content looks, including colors, fonts, spacing and layout.
Element
A piece of an HTML page, usually made of an opening tag, content and a closing tag, such as a paragraph or a link.
Tag
A keyword in angle brackets, such as <p> or </p>, that marks the start or end of an element.
Attribute
Extra information on an opening tag, written as name="value", such as href on a link or alt on an image.
Void element
An HTML element with no content and no closing tag, such as img, br or input.

Frequently asked questions

Is HTML a programming language?

Strictly speaking, no. HTML is a markup language: it labels content (this is a heading, this is a link) rather than giving step-by-step instructions. CSS is a style sheet language. JavaScript is the programming language of the web. Together the three build almost every website.

What do I need to start writing HTML and CSS?

Only a text editor and a web browser. Save a file with the .html extension, open it in your browser, and you will see your page. A free code editor such as VS Code adds helpful features like color highlighting and auto-completion, but it is optional.

Should I learn HTML and CSS before JavaScript?

Yes, for most people. JavaScript changes HTML and CSS on the page, so you need to understand what it is changing. Many useful sites need little or no JavaScript at all.

Should I use Flexbox or CSS Grid?

Both, for different jobs. Flexbox is best for arranging items in one direction, such as a navigation bar or a row of buttons. Grid is best for two-dimensional layouts with rows and columns, such as a page layout or a photo gallery. Many pages use Grid for the overall layout and Flexbox inside components.

Do I still need to learn HTML and CSS if I use a website builder or AI tools?

Builders and AI tools can generate pages quickly, but knowing HTML and CSS lets you fix what they get wrong, customize beyond their templates, make pages accessible and understand what is happening when something breaks.

How long does it take to learn HTML and CSS?

You can learn the essentials covered here in a few focused sessions and build a simple page right away. Becoming comfortable with layout and responsive design usually takes a few weeks of regular practice on your own projects.

Can I publish a website for free?

Yes. Several services host static HTML and CSS sites for free, usually with a free subdomain. A custom domain name typically costs a small yearly fee.

Sources and further reading

Related courses

TeensBeginner

Build Your First Website

HTML, CSS and a little JavaScript, from a blank file to a site online

Technology & Programming
1 h 55 min11 lessonsCertificate
University studentsBeginner

APIs, REST and JSON Basics

How apps talk to each other, from HTTP requests to designing your own API

Technology & Programming
2 h 25 min12 lessonsCertificate
Adults & professionalsBeginner

JavaScript for Beginners

Variables, functions, arrays, objects, the DOM and async code

Technology & Programming
2 h 10 min12 lessonsCertificate
Adults & professionalsBeginner

Computer Basics

Hardware, files, the internet, email and staying safe, from zero

Technology & Programming
2 h12 lessonsCertificate
Adults & professionalsBeginner

Excel Fundamentals

Formulas, lookups, tables, PivotTables and charts from zero to confident

Technology & Programming
2 h 10 min12 lessonsCertificate
Adults & professionalsBeginner

Python for Beginners

Write real programs with variables, loops, lists, dictionaries and functions

Technology & Programming
2 h 15 min12 lessonsCertificate