๐ŸŒ
๐ŸŒ Web Development Basics ยท WEB-101 ยท Session 2 of 6

HTML & CSS: Structure and Style

A web page is content (HTML) with styling (CSS) laid over it. You don't need to be a designer โ€” just enough HTML and CSS to build clear, usable pages for the apps you make.

โฑ 9 min read๐Ÿ“… Updated 2026-08-02๐Ÿ“Š Tables, charts & examples

The pages a server sends back are written in HTML - the language of web content - usually with CSS for styling. As a developer building web apps, you don't need to be a visual designer, but you do need enough HTML and CSS to produce clear, usable pages. The good news: the basics are quick to learn and go a long way. This session gives you the working knowledge to build real pages.

HTML: the structure

HTML marks up content with tags that say what each piece is - a heading, a paragraph, a link, a list, an image.

<h1>My Reading List</h1>
<p>Books I've enjoyed this year:</p>
<ul>
  <li><a href="/books/dune">Dune</a></li>
  <li>Project Hail Mary</li>
</ul>
<img src="cover.jpg" alt="a book cover">
๐ŸŽฏ
HTML describes what content is, not how it looks. An <h1> is a top-level heading, a <p> a paragraph, an <a> a link, a <ul> a list. Tags usually come in pairs that wrap their content (<p>...</p>), and can nest. You already generate HTML with the stack's larztemplate and larzmarkdown - now you understand what you're producing. A page is just structured content marked up with these tags.

CSS: the style

CSS controls how HTML looks - colours, fonts, spacing, layout. You write rules that select elements and set their appearance.

h1 { color: navy; font-size: 32px; }

.card {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 16px;
}
ConceptWhat it does
SelectorPicks which elements (h1, .card, #id)
PropertyWhat to change (color, font-size, padding)
ValueWhat to set it to (navy, 16px)
ClassA reusable label you put on elements

You don't need to memorise CSS - you look properties up as you go. A little CSS (some spacing, readable fonts, a sensible layout) makes a huge difference to how finished an app feels, and you can lean on simple, clean styles rather than fancy design.

Enough to build real pages

  • HTML structures content with tags that say what each piece is.
  • Tags usually wrap content in pairs and can nest (headings, paragraphs, links, lists).
  • CSS styles it - selectors pick elements, properties set their appearance.
  • You don't need to be a designer - just clear, usable pages; look things up as you go.

๐ŸŽฏ Key takeaways

  • Web pages are HTML (content structure) with CSS (styling) laid over them.
  • HTML uses tags to describe what content IS (heading, paragraph, link, list) - not how it looks.
  • CSS controls appearance: selectors pick elements, properties set colour, spacing, fonts, layout.
  • You don't need to be a designer - just enough HTML/CSS for clear, usable pages, looked up as you go.

Frequently asked

Do I need to learn HTML and CSS deeply, or is a basic grasp enough to build web apps?

For most developers building web apps - especially with your programming strengths on the server side - a solid basic grasp of HTML and CSS is genuinely enough to build real, useful things, and you can deepen it later if you find you enjoy or need the front-end craft. The essential HTML is a small set of tags you'll use constantly: headings, paragraphs, links, lists, images, and the form elements (which the input session covers), plus the idea that tags wrap content and nest. That's learnable in an afternoon and covers the structure of most pages. For CSS, you need enough to make pages readable and reasonably laid out - setting fonts, colours, spacing, and basic layout - and crucially you don't memorise CSS, you look up properties as you need them, because there are many and nobody keeps them all in their head. A little clean CSS goes a long way toward making an app feel finished, and you can rely on simple, tidy styling rather than elaborate design. Where deeper front-end skill becomes valuable is if you want to build highly polished, interactive, visually sophisticated interfaces, or specialise as a front-end developer - then HTML/CSS (and JavaScript) become a craft worth serious study. But plenty of valuable software has a straightforward interface, or delivers its value through an API rather than a fancy UI at all, so you shouldn't feel you must become a design expert to build worthwhile web apps. A practical approach: learn the core HTML tags and enough CSS to make clean, usable pages (which this session gives you the frame for), build things, and look up specifics as you hit them. Your programming skills plus competent HTML/CSS is a powerful combination that can build a great deal. Go deeper on front-end only if it draws you or a project demands it - it's an option, not a prerequisite, for being a capable web developer.

What's the actual relationship between HTML and CSS - why are they separate?

HTML and CSS are separate because they do fundamentally different jobs, and keeping them apart makes both easier to work with - it's a clean example of separating concerns. HTML's job is structure and meaning: it marks up your content to say what each piece is - this is a heading, this is a paragraph, this is a link, this is a list. It's about the content and its organisation, independent of appearance. CSS's job is presentation: it says how that structured content should look - what colour the headings are, how much space around paragraphs, the fonts, the layout. The power of separating them is that the same HTML content can be styled completely differently by swapping the CSS, without touching the content itself, and you can change your site's entire look by editing CSS while leaving all the HTML alone. It also keeps each file focused and readable - your HTML stays about content, your CSS about appearance - rather than tangling look-and-feel into every line of content. The way they connect is that CSS 'selectors' target HTML elements: a CSS rule like 'h1 { color: navy }' finds all the h1 headings in the HTML and colours them, and you can add 'class' labels to HTML elements (like class='card') so CSS can style just those. So HTML provides the structured content and the hooks (tags, classes, ids), and CSS reaches in through those hooks to style them. A helpful analogy: HTML is like the skeleton and organs of a page (its structure and content), while CSS is the skin, clothing and appearance laid over that structure. You write the content and structure once in HTML, then style it - and restyle it freely - in CSS. This separation is why you can have themes, why redesigns don't require rewriting content, and why the two are learned as distinct but complementary languages. Content in HTML, looks in CSS.

Session 2 of 6 complete

Next up: How Servers Build Pages

Continue to Session 3 โ†’

Related lessons

More in this course

Course home → · Browse all courses →