Free · 8 min read
HTML and CSS for designers: the basics worth knowing
What designers need to know about HTML and CSS: semantics, the box model, flexbox and grid, units, responsive design. No jargon, plus a practice exercise.
- Why it helps a designer to understand front-end code
- Five ideas behind most "that can't be built" moments
- Exercise: code one card from your own layout
- Free
- 1,504 members
- Join in 1 click
Five steps to understanding HTML and CSS as a designer
- 1
Step 1
HTML is content and meaning, not appearance
- 2
Step 2
The box model: everything on the page is a box
- 3
Step 3
Flexbox and grid: how rows and columns are built
- 4
Step 4
Units and responsive design
- 5
Step 5
Exercise: code one card
- 1,504
- community members
- 8,915
- messages with questions since July 2024
- 9
- design games since September 2024
- 759
- people wrote in the chat
This guide is for you if you
Design interfaces
You make layouts in Figma but don't always understand why the built site looks different.
Work with developers
You want to speak the same language (padding, flex, breakpoint) and hand off layouts without a hundred questions.
Plan to use site builders
You're heading into Webflow, Framer or Tilda and want to understand what's going on under the hood.
In short
- A designer doesn't have to code, but understanding HTML and CSS makes layouts realistic and conversations with developers shorter.
- HTML describes what is on the page (a heading, a button, a list); CSS describes how it looks and where it sits.
- Everything CSS displays is a box: content, padding, border, margin. That's the box model.
- Rows and columns on the web are built with flexbox and grid. Auto layout in design tools follows a similar logic.
- The best way to understand it is to code one card from your own layout in a plain text file.
Five steps to understanding HTML and CSS as a designer
- 1
Step 1
HTML is content and meaning, not appearance
HTML describes a page's structure: what's a heading, a paragraph, a list, a button, a link. This determines how search engines and screen readers, used by blind people, read the page. So in a layout it matters not only how an element looks but also what it is.
- headings have levels: one main h1 per page, then h2 for sections and h3 for subsections; font size has nothing to do with it;
- a button performs an action on the page, a link (a) goes to another address; it's worth telling them apart in the layout;
- images that carry meaning need a text description (alt); prepare it along with the layout.
💡 Look at your layout and label every block: "header", "nav", "main", "section", "footer". If you can't decide what a block is, the developer will be guessing too.
- 2
Step 2
The box model: everything on the page is a box
As web.dev puts it, everything CSS displays is a box. Each one has four layers: content, padding, border and margin. When you put a button's text 16 px from its edge in a layout, for a developer that's padding. When there's 24 px between two cards, that's margin or gap.
- keep spacing in the layout to a short set of values (for example 4, 8, 16, 24, 32, 48), so it's easy to carry over to CSS;
- boxes on the web grow with their content: a two-line heading makes a card taller, and the layout should handle that;
- if text sticks to an edge, the layout most likely has no padding, only a position set by eye.
Show your first coded card
Coded a card but something's off? The community has people at every stage, from first steps to leads, and they share their experience. It's free to join.
Get feedback on your codeFree. 1,504 designers are already in the community.
- 3
Step 3
Flexbox and grid: how rows and columns are built
CSS has two main layout tools. Flexbox lines elements up in a single row or column: a menu, a row of buttons, a card with an icon and text. Grid builds a two-dimensional grid of rows and columns: a gallery, a grid of cards, a page layout. Auto layout in Figma or Flex Layout in Penpot follow a similar logic: direction, the gap between elements, alignment, padding. Penpot's Flex Layout is built directly on the CSS Flexbox standard.
- direction (row or column): side by side or stacked;
- gap: an even space between elements, with no separate margins on each;
- justify-content and align-items: how elements align along and across the direction;
- flex-wrap: move elements to a new line when there's not enough room.
💡 If your layout uses auto layout with no free-floating elements, it's almost always easy to build. If everything is placed by hand, the developer has to guess the rules.
- 4
Step 4
Units and responsive design
Screens vary, so a web page isn't a fixed sheet. Sizes in CSS use different units: px for fixed pixels, % for a share of the parent box, rem relative to the base font size. MDN notes that the browser's default font size is usually 16 px, and that font sizes in px are bad for accessibility: in some browsers the user then can't enlarge the text. For different screen widths CSS uses media queries, which is where "breakpoints" come from.
- show at least two versions in the layout: phone and desktop;
- decide what happens to blocks in between: columns become rows, images shrink, the menu collapses;
- check text contrast: for normal text, WCAG requires at least 4.5:1.
- 5
Step 5
Exercise: code one card
Theory sticks only after practice. Take one card from your layout (a photo, a heading, short text, a button) and code it. All you need is a text editor and a browser: create an index.html file, write the structure and add styles in a style tag. Then open the file in the browser, right-click an element and choose Inspect: DevTools shows each element's box model, and you can change styles live.
- HTML first, without styles: check that the order and meaning are clear even without design;
- then CSS: font, colors, padding, radius, flexbox for a button with an icon;
- narrow the browser window: does the card break at phone width;
- check the markup with the W3C validator: it shows errors in the HTML.
💡 Compare the result with your layout and write down everything that came out differently. That list is the best feedback to yourself: it shows which layout decisions had no rule behind them.
You're not alone with these questions
We counted what people ask about most in our community. Learning and courses come first. "Does a designer need to learn code?" is one of the questions that gets asked and discussed there.
Messages by topic in Spaceberry Community, July 2024 — November 2026. Keyword search.
Practice with a deadline and live feedback
The best teacher is a task with a deadline that other people see. That's why the community regularly runs design games: the same brief for everyone, a deadline and a vote.

Design game · January 2026
NAOMA website redesign
The academy's home page through the eyes of an applicant, a student and a teacher. Three finalists; the community chose the winner.

AI challenge · May 2025
A landing page made by AI
Logo, copy and visuals made only with AI tools. Four entries, an anonymous vote, and participants shared their prompts.

Workshop · April 2026
Figmosha: AI in Figma
The tool's author showed how to generate interfaces in Figma and analyze a design system.
Free. 1,504 designers are already in the community.
How to join: 1 minute
- 1
Tap the button
Telegram opens with the Spaceberry community.
- 2
Join
It's free: all you need is a Telegram account.
- 3
Introduce yourself
Say where you're starting from and ask your first question.
Questions and answers
Didn't find your answer? Ask it in the community.
Does a UI/UX designer need to code?
Coding at a developer's level isn't required. But understanding how HTML and CSS work is very useful: you make layouts that can actually be built, name things correctly and reach agreement with the team faster. A plan for the first months is in [How to become a UI/UX designer from scratch](/en/guides/start-ui-ux).
How long does it take to understand the basics?
It depends on how much you practice. You can try the core ideas from this guide in one evening on one card. After that, small exercises work best (a section, a page, a responsive version) rather than long theory without practice. Code one small block from your own design each week, and within a few weeks the box model and flexbox stop being a mystery.
Where can I learn HTML and CSS for free?
Good free resources: Learn web development on MDN (a structured course from the basics) and the Learn HTML, Learn CSS and Learn Responsive Design courses on web.dev. Both are in English. Pair them with practice: after reading the flexbox section, code a row of cards from your own design right away and check it in the browser.
Do Webflow, Framer or Tilda replace knowing HTML and CSS?
They let you skip writing code, but they follow the same rules. People who understand the box model and flexbox get the hang of site builders much faster. In Webflow, for example, you set the same padding, margin, flexbox and classes, just in a visual panel instead of code.
Is the Spaceberry community paid?
No, Spaceberry Community is free. It's run by Spaceberry Foundation, a non-profit organization. All you need to join is a Telegram account. In the chat you can ask questions, share your work for feedback and take part in design games: the same brief for everyone, a deadline and a community vote. Conversations are in Ukrainian.
Coded your card? Show the design and the code side by side
Join 1,504 designers who learn, share their work and play design games. Show what you built and ask where the code drifted from the design. The community talks in Ukrainian.
- Free
- 1,504 members
- Join in 1 click
Updated · Spaceberry Foundation
Sources:
- MDN — Learn web development
- MDN — The box model
- MDN — Flexbox
- MDN — Grids
- MDN — font-size (default size, px and accessibility)
- web.dev — Learn HTML
- web.dev — Learn CSS
- web.dev — Learn CSS: The box model
- web.dev — Learn Responsive Design
- Penpot — Flexible Layouts (Flex Layout built on CSS Flexbox)
- Chrome DevTools — View and change CSS
- W3C Markup Validation Service
- W3C — Understanding WCAG 2.2: Contrast (Minimum)