Skip to content
Tutorials Center
My learning

Topics

Lesson 5 of 37 ยท Concepts and Setup

How Websites Work: What Builders Generate

Learn the HTML, CSS, DOM and request-response ideas behind every Wix and Webflow site, so the panels you click make sense and you can debug layouts and speed problems.

Visual builders hide code, but they do not remove it. Every element you drag becomes HTML, every panel setting becomes a CSS rule, and every published page is delivered by the same web protocols as any other site. People who understand those layers troubleshoot faster, design better and communicate clearly with developers. You do not need to write code to benefit. You only need the mental model.

This lesson gives you that model in plain language, with small JavaScript stand-ins you can run to see the ideas working. The stand-ins are teaching aids: they imitate how browsers and builders behave, they are not Wix or Webflow code.

What happens when someone opens your site

When a visitor types your address or clicks a link, the browser performs a short conversation with a server.

sequenceDiagram
  participant V as Visitor's browser
  participant D as DNS
  participant S as Builder hosting / CDN
  V->>D: Where is www.example.com?
  D-->>V: Server address
  V->>S: GET / (request the page)
  S-->>V: HTML
  V->>S: GET styles.css, image.jpg, script.js
  S-->>V: Files
  V->>V: Build the page and draw it

A page view is one request for HTML followed by requests for everything the HTML mentions.

Three ideas matter to a builder user:

  1. DNS translates a name into a server address. The next lesson covers it.
  2. HTML arrives first and tells the browser what the page contains.
  3. Every extra file costs time. Large images, fonts and scripts are the usual reasons for slow pages, which is why performance gets its own chapter.

HTML: the structure

HTML describes content as nested elements. An element has a tag, optional attributes, and content.

HTML
<section class="hero">
  <h1>Maple Bakery</h1>
  <p>Fresh bread, daily.</p>
  <a href="/order" class="button">Order now</a>
</section>

The browser turns this text into a tree called the DOM (Document Object Model). A heading is a child of a section, a section is a child of the page body. Builders show you the same tree in the Navigator or Layers view. Some elements are semantic: they tell browsers and search engines what the content means (header, nav, main, section, article, footer, h1 to h6). Using the right element for the job helps accessibility and SEO, and Webflow lets you choose the tag of many elements, while Wix lets you set heading levels and some landmark roles.

CSS: the appearance

CSS is a list of rules. Each rule has a selector (which elements) and declarations (what to change).

CSS
.button {
  background: #1d4ed8;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
}

When you change a button's background in the Style panel, the builder writes a rule like this one. Webflow shows the class name directly (button), so you know which rule you are editing. Understanding that styles belong to classes, not to individual elements, is the single most important Webflow concept, and lesson Classes and the Box Model in Webflow develops it fully.

The cascade, in one paragraph

Several rules can target the same element. The browser picks the winner by specificity (a more specific selector wins), then source order (later wins ties), and inherited values such as color and font-family flow from parent to child unless overridden. This is why changing a body font changes nearly all text, and why an override on a button can fail silently when a more specific rule exists.

The box model

Every element is a rectangular box with four layers.

flowchart TB
  M["margin: space outside the box"] --> B["border: the box edge"]
  B --> P["padding: space inside the box"]
  P --> C["content: text, images"]

Margin sits outside, then border, padding, content. Size = content + padding + border.

Misunderstanding this model causes most beginner layout problems: spacing that adds up unexpectedly, boxes that overflow their parent, and elements that refuse to line up. The stand-in below computes the real size of a box under the two sizing modes CSS offers: content-box (width means the content only) and border-box (width includes padding and border). Webflow and most modern sites use border-box by default, which is easier to reason about.

JS Stand-in: box model size calculator

Press Run (or Ctrl + Enter) to see the console output here.

No output.

The same width: 300px produces boxes of different real sizes. With content-box, adding padding makes the box grow past 300. With border-box, the box stays at 300 and the content area shrinks.

JavaScript: the behavior

JavaScript runs in the browser to react to clicks, animate things, fetch data or validate forms. Builders add JavaScript for you when you use interactions, menus, sliders and lightboxes. You can also add your own through custom code areas. Every script is another file to download and execute, so more scripts mean more work for the visitor's device.

Static versus dynamic

A static page is the same HTML for everybody. A dynamic page is assembled from data (CMS items, product records, user accounts). Builders blur the line: a Webflow CMS page is generated from a template and then published as static HTML, while a Wix dynamic page can pull data when requested. Knowing which one you have explains why a content change sometimes needs a publish (static output) and sometimes appears immediately.

Seeing the generated code

Every browser has developer tools (usually opened with F12 or by right-clicking and choosing Inspect). They show the DOM, the CSS rules applied to a selected element, the network requests and the page weight. You do not need to write anything: just look. Select your hero heading, see which rule sets its color, and you will understand why the Style panel shows what it shows.

Try the next stand-in to see how selectors, specificity and source order choose a winner. It is simplified to three selector kinds.

JS Stand-in: which CSS rule wins?

Press Run (or Ctrl + Enter) to see the console output here.

No output.

.card p (one class, one tag) beats .lead (one class) because it also has a tag in its specificity, so gray is chosen over blue. The plain p rules lose to both. Change the rules and predict the winner before you run it.

Why this matters for Wix and Webflow users

  • Layout bugs are usually box model, nesting or sizing issues.
  • Style bugs (a color that will not change) are usually cascade issues: an inherited or more specific rule is winning.
  • Slow pages are usually too many or too large files.
  • SEO and accessibility depend on choosing semantic elements and writing clear text.
  • Handing work to a developer is far smoother when you can name the thing you want changed.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does the browser build from HTML text?

    The DOM is the tree the browser builds, and builders show it as the Navigator or Layers view.
  2. 2. With box-sizing set to border-box, what does width: 300px include?

    border-box counts padding and border inside the declared width. Margin is always outside.
  3. 3. Two class selectors target an element and both set color. What decides the winner if specificity is equal?

    With equal specificity, the later rule in source order wins.
  4. 4. Why are semantic elements such as nav and main useful?

    Semantics help assistive technology and search engines understand the page structure.

Summary

  • A page view is a request for HTML followed by requests for the files it references.
  • HTML makes the structure (the DOM), CSS makes the appearance, JavaScript adds behavior.
  • Everything is a box: content, padding, border, margin. Sizing mode changes the arithmetic.
  • The cascade (specificity, then order, plus inheritance) decides which style wins.
  • Browser developer tools let you inspect what your builder generated.

Next: Domains, DNS and Hosting