Build a bicycle workshop website with a responsive service grid, a visible focus indicator, and an opening-hours link.
Build a one-page website for a fictional bicycle repair workshop. It will introduce the workshop, explain its three services, and make the opening hours easy to find. You can paste the complete example into the HTML editor or save it as a file and open it directly in your browser. As you work through it, pay attention to which problems you solve in HTML and which you solve in CSS. The end result is a small page you can adapt for a club, an event, or a personal project.
Plan the content before choosing colours
Write a one-sentence introduction that tells people what the workshop does and who it serves. Keep the three services separate so a visitor can scan them. Finally, put the opening hours in their own section. The prototype uses a link near the top to scroll directly to those hours. This is a useful first interaction because it works with HTML alone. There is no navigation script to debug or server to configure.
Our page has one clear purpose: help someone decide whether to visit. If you were building a real site, you would also verify the physical address, contact details, price information, and closed dates. Those belong to the editorial design, separate from whether the fonts or colours feel right. Write accurately before styling. Keep fictional details clearly fictional when you share a demo, and replace them with verified information before publishing a real business page.
Put the markup and styles together
Create a file called index.html. Place it in a new folder so your prototype is easy to find. Paste the following complete file. The styles live in the head for this exercise, so everything you need is in one file. In a site with multiple pages, move shared styles to a separate stylesheet when you have a reason to reuse them.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Willow Cycle Workshop</title>
<style>
* { box-sizing: border-box; }
body { margin: 0; font: 1rem/1.6 system-ui, sans-serif; color: #10244a; background: #f1f8ff; }
.wrap { width: min(100% - 2rem, 64rem); margin-inline: auto; }
header { padding-block: 3rem; background: linear-gradient(120deg, #e0f3ff, #dcf6d2); }
main { padding-block: 2rem; }
h1, h2, h3 { line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); margin: 0; }
.intro { max-width: 55ch; }
.cta { display: inline-block; padding: .7rem 1.2rem; border-radius: .75rem; background: #0053ad; color: white; }
.cta:hover { background: #003d82; }
:focus-visible { outline: 3px solid #10244a; outline-offset: 4px; }
.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 1rem; }
.service { background: white; border: 1px solid #cadff2; border-radius: 1rem; padding: 1rem; }
.service h3 { margin-top: 0; }
#hours { margin-block-start: 2rem; }
</style>
</head>
<body>
<header>
<div class="wrap">
<h1>Willow Cycle Workshop</h1>
<p class="intro">A fictional neighbourhood workshop for quick bicycle repairs and basic maintenance sessions.</p>
<a class="cta" href="#hours">Check opening hours</a>
</div>
</header>
<main class="wrap">
<section aria-labelledby="services-title">
<h2 id="services-title">Workshop services</h2>
<div class="services">
<article class="service"><h3>Safety check</h3><p>Check tyre pressure, brakes and lights before a ride.</p></article>
<article class="service"><h3>Puncture repair</h3><p>Replace a damaged inner tube and check the tyre for debris.</p></article>
<article class="service"><h3>Maintenance session</h3><p>Learn how to clean and lubricate your chain.</p></article>
</div>
</section>
<section id="hours" aria-labelledby="hours-title">
<h2 id="hours-title">Opening hours</h2>
<p>Saturday, 10 a.m. to 2 p.m. This is demonstration content.</p>
</section>
</main>
</body>
</html>
Try it in the HTML editor
If you are using the online editor, paste the entire document in the HTML tab. Clear any earlier CSS and JavaScript so previous experiments do not change the result. If you saved a file instead, open it in your browser. When editing locally make sure the URL points to the same folder you are editing. If an old file is already open in another tab, it is easy to refresh the wrong copy and think your changes were ignored.
Understand how the styles reach their targets
A class is a name you can apply to more than one element. Every service card has the same class, so adding padding to that rule changes all three cards. The wrapper class appears in the header and main areas. It limits the line length and gives the edges of the page breathing space. These class names describe their jobs and make it easier to change the appearance without rewriting the markup.
Look at the wrapper width first. The smaller of two lengths wins. On a wide screen the body can span the viewport, but the content has a maximum width. On a narrow screen the available width minus the two edges is smaller, so the wrapper shrinks. The auto inline margins centre the wrapper in each case. Colour the wrapper temporarily with a faint background if you want to see exactly where the edges sit. Remove the test colour when you finish debugging.
The heading size uses a fluid value with lower and upper limits. The text grows on wider displays, but it does not keep growing beyond the cap. Small screen headings also have a readable floor. Some sites need more room for translated headings, so type a much longer workshop name and check where it wraps. Avoid setting a fixed height on a header whose contents may wrap onto another line.
See where the grid changes
The services container is a grid. Each track prefers to be at least fifteen rem wide, but the minimum is capped by the space available. That cap matters when a phone is narrower than the intended card width. The fractional maximum allows tracks to fill the space they share. The browser fits as many tracks as it can without resorting to a separate media query for every device size. The gap sets spacing between the tracks, and padding inside each article sets spacing between the card edge and its text.
Drag the browser window narrower, or switch the online preview to its mobile width. Look for a change from three columns to fewer columns rather than a smaller copy of the desktop layout. A design can have more than one acceptable layout. Check that the content still reads in order and that no words run off the right edge. Open the CSS editor if you want to isolate and change the grid declaration with fewer distractions.
Test the page as a visitor would
Press Tab from the start of the page. The opening-hours link should receive visible focus. Press Enter and check that you reach the hours section. The fragment at the end of the address must match the destination identifier exactly. If clicking works but there is no visible change, the target may already be in view. Make the viewport shorter or add another service temporarily to give the page enough room to scroll.
Next increase browser zoom. Read every card and check that the heading still has space. Try making one service description twice as long. The grid can accommodate unequal content heights because there is no fixed card height. If you want the cards to feel balanced, edit the writing first. Equal amounts of copy are easier to scan, but a hard character limit can make it harder to explain an important difference.
If a CSS change has no effect, inspect the element and check whether your rule is listed. A misspelled class can prevent a selector from matching. An invalid value can make the browser ignore one declaration while retaining the rest. A missing closing brace can make later rules hard to locate. Use the formatters to tidy deeply nested source, then simplify the test by changing one property at a time. Restore the working example if you need a known starting point.
A locally opened file is already a working webpage. A public site additionally needs a host, accurate content, and working links. Before publishing, change the title and details, test the final URL on a phone, and check the page structure again when the content changes. For styling reference, see MDN's guide to getting started with CSS.
Separate the files when you need to reuse the design
After the single-file version works, make a copy of the project. Create workshop.css next to your HTML file and move the rules from inside the style element to that file. Leave the HTML style tags out of the stylesheet. In the document head, replace the old style element with a stylesheet link whose address is the new filename. Refresh the page and check that the workshop keeps its design. This is a useful exercise before adding another page that needs the same header or cards.
If the page becomes plain after the move, keep the original version open as a comparison. Check the stylesheet filename, the extension, and where the file sits relative to the document. In a browser’s developer tools, the network panel can tell you whether the stylesheet was loaded. If it loaded, inspect a card to see whether the expected selector matches. The distinction matters because a missing file and an unmatched selector both look like missing styles, but they require different fixes. Once both files work together, add a second page that reuses the same stylesheet and change one shared rule to see it update both pages.