Find a course

Module 5: Responsive Design and PublishingLesson 12 of 1212 min

Building and Publishing Your Page

Organize project files, check your HTML and CSS for errors and accessibility, speed up loading, and publish a static site online for free.

Step 1 of 14Learn

From one file to a small project

You've learned the pieces. Now let's put them together the way professionals do, starting with how files are organized.

A small site might look like this:

my-site/
  index.html
  about.html
  contact.html
  css/
    styles.css
  images/
    hero.webp
    team.jpg

Conventions that save headaches:

  • Name the home page index.html, so servers send it by default.
  • Use lowercase file names with hyphens, no spaces: team-photo.jpg, not Team Photo.JPG. Many web servers are case-sensitive, so a link to team.jpg won't find Team.jpg, even though it works on your own computer.
  • Keep one shared stylesheet linked from every page, so the whole site stays consistent and you can restyle it in one place.
  • Use relative links between your pages (href="about.html", src="images/team.jpg") so the site works both on your computer and once uploaded.

Inside styles.css, a helpful order is: a small reset (box-sizing: border-box, image max-width), base styles for body and headings, layout (containers, grids), components (buttons, cards, nav), then utilities and media queries. Short comments between sections make the file easy to navigate months later.

Step 2 of 14Practice · What would you do?

What would you do?

Priya's site works perfectly when she opens it on her laptop, but after uploading it to a web host, the team photo is missing. Her HTML says <img src="images/Team-Photo.jpg"> and the file is named team-photo.jpg. What is the most likely problem?

Step 3 of 14Diagram

A tidy small-site folder

Use lowercase file names without spaces: many web servers treat Logo.png and logo.png as different files.

A tidy small-site folderHierarchy diagram: my-site/, index.html, about.html, css/, images/, style.css, logo.svg, team-photo.webp.my-site/index.htmlabout.htmlcss/style.cssimages/logo.svgteam-photo.webp

Tap a shape with to see more.

my-site/
index.html

The home page; servers send it when someone visits the folder.

about.html
css/
images/
style.css
logo.svg
team-photo.webp

Step 4 of 14Learn

Check before you publish

Browsers are forgiving: they'll display broken HTML without complaint, so errors often go unnoticed until a page behaves strangely in one browser or for one group of users. A quick checklist before publishing catches most problems.

Validate the code. The free W3C Markup Validation Service checks your HTML for unclosed tags, invalid nesting, duplicate IDs and missing attributes. A CSS validator does the same for stylesheets.

Check accessibility.

  • Every image has appropriate alt text (empty for decorative images).
  • Headings form a logical outline with one h1.
  • Every form field has a label.
  • Text meets contrast requirements (4.5:1 for body text).
  • You can reach and use everything with the keyboard alone: press Tab through the page and make sure the focus outline is always visible.
  • The page has a lang attribute and a descriptive title.

Browsers include automated audit tools (in Chrome, the Lighthouse panel) that flag many of these issues, though they can't judge everything, such as whether alt text actually makes sense.

Check links and layout. Click every link. Resize the window from phone width to wide desktop and look for overflow, overlapping text and awkward gaps. Test in at least two different browsers.

Step 5 of 14Practice · Select all that apply

Which items belong on a pre-publishing checklist? Select all that apply.

Select all that apply.

Step 6 of 14Diagram

A five-minute pre-publish routine

A five-minute pre-publish routineProcess diagram: Validate the HTML → Click every link → Test at phone width → Check alt text and contrast → Check image sizes.Validate the HTMLClick every linkTest at phone widthCheck alt text andcontrastCheck image sizes

Tap a shape with to see more.

Validate the HTML

The W3C validator flags unclosed tags and typos browsers silently forgive.

Click every link
Test at phone width

Device mode in developer tools, then a real phone.

Check alt text and contrast
Check image sizes

The biggest speed win on most simple sites.

Step 7 of 14Learn

Make it fast

Visitors abandon slow pages, especially on phones. Most speed problems in simple sites come from a few sources, all fixable.

Images are usually the biggest factor. Resize them to the size they display, compress them, use modern formats like WebP or AVIF, include width and height attributes so the layout doesn't jump, and add loading="lazy" to images below the first screen.

Fonts: each web font weight is a separate download. Use one or two families and only the weights you need, or use system fonts for zero download.

CSS and scripts: link one stylesheet rather than many, and avoid loading big libraries for small effects. Plain CSS can now do transitions, animations, layout and responsive behavior that once needed JavaScript.

Caching: browsers store files they've downloaded, so a shared stylesheet loads once and is reused on every page.

How heavy is too heavy? There's no hard rule, but a simple content page that totals well under 1 MB will feel quick on most connections. A single unoptimized phone photo can be several megabytes on its own.

The Lighthouse tool mentioned earlier also measures performance and lists the biggest improvements first, which is a good guide to where to spend your effort.

Step 8 of 14Practice · Work it out

A page has 8 photos at 2.5 MB each. After resizing and converting to WebP, each photo is 150 KB. About how many megabytes smaller is the page? (Use 1 MB = 1,000 KB.)

Step 9 of 14Chart

Page weight before and after optimizing 8 photos

Same photos, same look on screen: resized to display size and converted to WebP.

Page weight before and after optimizing 8 photosBar chart with 2 categories: Before (8 × 2.5 MB): 20 MB; After (8 × 150 KB): 1.2 MB.0 MB5 MB10 MB15 MB20 MBBefore (8 × 2.5 MB)After (8 × 150 KB)20 MB1.2 MB
Page weight before and after optimizing 8 photos
ItemTotal image weight
Before (8 × 2.5 MB)20 MB
After (8 × 150 KB)1.2 MB

Step 10 of 14Learn

Publishing your site

A site made only of HTML, CSS and image files is called a static site: the server just sends files as they are, with no database or server code. Static sites are fast, secure and often free to host.

Common ways to publish:

Static hosting services. Several platforms offer free hosting for static sites. You typically drag your project folder onto a web page or connect a code repository, and within a minute your site is live at a free subdomain. Most include HTTPS automatically.

Code repository hosting. Some code-sharing platforms can publish a repository as a website, which is popular with developers and students building portfolios.

Traditional web hosting. A paid hosting plan gives you server space where you upload files, often by FTP or a file manager, and usually includes email and a domain.

To use your own address, like www.yourname.com, you register a domain through a domain registrar for a yearly fee, then point it at your host by updating its DNS settings, following your host's instructions.

After launch, keep going: add a favicon (the small icon in the browser tab), write a meta description for each page, which search engines may show in results, and keep improving. Every professional site started as a simple page someone was brave enough to publish.

Step 11 of 14Note

Step 12 of 14Practice · Put in order

Put the steps for launching a simple personal site in order.

Drag the items, or use the arrow buttons, to put them in order.

  1. Optimize images for faster loading
  2. Upload the folder to a static hosting service
  3. Point your own domain name at the host (optional)
  4. Build and organize the pages, stylesheet and images locally
  5. Validate the HTML and check accessibility and layout

Step 13 of 14Note

Step 14 of 14Practice · Match the pairs

Match each publishing term with its meaning.

Tap an answer, then tap the place where it belongs (or drag it there).

  1. Static site
  2. Domain registrar
  3. DNS settings
  4. Favicon
  5. Meta description