- Learn
- Computer Science & IT
- Programming
- Web Development Basics
- Publishing a Website
Publishing and Maintaining a Website
BeginnerLesson 8 of 8 in Web Development Basics Course
What you will learn
- Set up a website's files so they work the same on your computer and on a server, link them with correct paths, and use validators to find mistakes in the HTML and CSS.
- Organize site files and foldersPlan one project folder with a home page, clear file names and separate folders for styles, scripts and images.
- Link pages and files with correct pathsWrite relative and absolute paths that find the right file both on your computer and after upload, and avoid the case and slash mistakes that only show up online.
- Validate HTML and CSSCheck pages and style sheets with the W3C validators, read their messages, and fix errors in a sensible order.
- Organize site files and folders
- Use the tools built into every major browser to see what the browser actually does with your HTML and CSS, find errors and missing files, and fix problems step by step.
- Inspect and adjust HTML and CSS liveOpen the developer tools, inspect an element, see which CSS rules apply to it and why, and try out fixes before changing your files.
- Find errors with the Console and Network panelsRead error messages, find missing or slow files, and understand the status codes the server sends back.
- Debug step by step and test across browsers and screen sizesFollow a repeatable process to find the cause of a problem, and check pages in several browsers and screen widths before publishing.
- Inspect and adjust HTML and CSS live
- Prepare images in the right format and size, add them to pages so they load efficiently, and measure and improve how fast pages appear.
- Prepare image files for the webChoose a suitable image format, resize images to the size they are shown at, and compress them without visible loss of quality.
- Add images to pages that load efficientlyWrite image markup that reserves space, offers the right file for each screen and format, and delays images the visitor has not scrolled to yet.
- Measure and improve page speedFind out what makes a page slow with measuring tools, read the Core Web Vitals, and apply the basic fixes that help most.
- Prepare image files for the web
- Give each page the HTML that helps search engines and link previews understand what it is about, find it and show it well.
- Describe each page with a title, description and headingsWrite a unique title and meta description, declare the page language, and structure content with meaningful headings and semantic elements.
- Help search engines find and index the right pagesUse links, clear addresses, robots.txt, a sitemap and canonical and noindex tags so the right pages can be found and shown in search results.
- Describe each page with a title, description and headings
- Understand what a static host does, choose one that fits the site, put the site online and publish updates safely.
- Understand static hosting and choose a hostExplain how static hosting differs from other kinds of hosting, and compare hosts by what a small site needs.
- Deploy a site and publish updatesPut a site online with the host's publishing method, check the live version, and publish later changes without breaking anything.
- Understand static hosting and choose a host
- Register a domain name, connect it to the host with DNS records, serve the site securely over HTTPS, and look after the site once it is live.
- Choose and register a domain nameRead the parts of a domain name, pick a suitable name and ending, and register and manage it with a registrar.
- Point a domain to the host with DNSCreate the DNS records a host asks for, understand how long changes take, and check that the domain points to the right place.
- Serve the site over HTTPSExplain what HTTPS protects, get and renew a certificate through the host, redirect all traffic to HTTPS and fix mixed content.
- Maintain a live siteKeep a published site correct, working, secure and reachable with routine checks, backups and renewals.
- Choose and register a domain name
Publishing a Website study guide
1Prepare files that work online
A site can look finished on your computer and still fail after upload. The server needs a complete, well-organized set of files, and the browser must be able to find each one through its address. Start by choosing the folder that will become the site root. Then trace links from their starting locations and check the HTML and CSS for errors that a browser may quietly repair or ignore.
1.1 The folder that becomes your website
A website needs one project folder containing every file visitors will use. This is the site root. Publishing is much easier when that folder is a complete, portable site: no images borrowed from Downloads and no style sheet left in another project's folder.
Give each kind of file a place
A small repair shop could use this layout:
riverside-bikes/
index.html
prices.html
contact.html
404.html
css/styles.css
scripts/menu.js
images/logo.svg
images/workshop-800.jpg
images/workshop-1600.jpg
blog/index.html
blog/winter-checklist.html
The HTML pages are the content, css/ holds styles, scripts/ holds JavaScript files, and images/ holds the images ready for visitors. A site without scripts does not need a scripts folder. Separate folders make related files easier to find without changing how a browser uses them.
Most web servers send index.html when a visitor requests a folder. The address https://www.example.com/ opens the root home page. The address https://www.example.com/blog/ opens blog/index.html. A file named home.html is still a page, but the server usually will not choose it for the bare site address.
Choose names before launch
Use lowercase letters, hyphens between words, and the correct extension. opening-hours.html and team-photo.jpg are clear names. Spaces can appear in URLs as %20, making an address harder to read and type. Names become part of the site's public addresses, so choose them for the content they identify.
The extension should match the file: .html for HTML, .css for CSS, .js for scripts, and a suitable image extension such as .jpg, .webp or .svg. The server sends a Content-Type header describing the file's format. Hosting systems commonly use extensions to choose that type. Renaming a photo from .jpg to .webp does not convert its contents; export it in the new format with an image tool.
Most servers distinguish uppercase and lowercase names. A link to Logo.svg can fail when the uploaded file is logo.svg, even if it worked on a computer with a case-insensitive file system. A lowercase naming habit keeps that difference out of new projects.
Separate public files from working files
Keep camera originals, design files and notes outside the site root, for example in riverside-bikes-originals/. Export only the prepared web images into images/. Files in the published folder can be downloaded even when no page links to them. Keep passwords, private documents and personal data out of that folder.
Before upload, check that every linked local asset is inside the project. A photo at a personal file:// address exists on your computer; it does not travel with the site unless you copy it into the published folder. After moving it, update the link and test it again.
A stable structure also protects links after launch. Moving prices.html to a new address breaks old bookmarks unless the host redirects that old address to the new page.
Key Takeaways
- The site root contains the complete public site, with
index.htmlat its top level. - Use descriptive lowercase names, hyphens and extensions that match the file contents.
- Keep original assets and private working files outside the published folder.
- Moving a published page requires a redirect to preserve its old address.
1.2 Paths from the page to the file
A path tells the browser where to look for a file. To write one correctly, identify both the file being requested and the location from which the browser will resolve the path.
Start in the referring file's folder
A relative path begins from the current page's folder. In the bike shop site, index.html links to prices.html with href="prices.html", to the logo with src="images/logo.svg", and to a post with href="blog/winter-checklist.html".
From inside blog/winter-checklist.html, the route changes:
<link rel="stylesheet" href="../css/styles.css">
<a href="../index.html">Home</a>
<img src="../images/logo.svg" alt="Riverside Bike Repair">
<a href="autumn-tips.html">Autumn tips</a>
For the logo, first go up from blog/ with ../, then enter images/. A file in the same folder needs only its name. Two levels up use ../../. Always use forward slashes / in web paths, including when writing on Windows.
A path in a CSS file starts from the CSS file's folder. In css/styles.css, the rule background-image: url("../images/pattern.svg"); goes up from css/ and then down into images/. It does not start from whichever HTML page happens to load the style sheet.
Distinguish three address forms
| Form | Example | Starting point |
|---|---|---|
| Relative path | ../images/logo.svg | Referring file's folder |
| Root-relative path | /images/logo.svg | Domain root |
| Absolute URL | https://www.example.com/images/logo.svg | Full stated web address |
An absolute URL includes the scheme and host name. Use one for another website. Relative paths let your own site move between a local server, a preview address and its final domain without replacing the domain in every link.
A leading slash has a specific meaning. At https://username.github.io/riverside-bikes/, /css/styles.css requests https://username.github.io/css/styles.css. It drops the project folder from the address. From the site's root page, css/styles.css keeps that folder and reaches the intended file.
Test the address the browser actually uses
Opening HTML directly from disk gives a file:// address. Folder links and paths beginning with / can behave differently there. Run a local development server from the site folder, for example with python3 -m http.server, or use a code editor's live preview. Then open the local HTTP address it supplies.
On a server, href="blog/" opens blog/index.html. If a link or image fails, open DevTools before reloading and find its request in Network. A 404 means the requested resource was not found. Read the full requested URL and compare each folder, slash, letter and extension with the uploaded files. A capital letter or missing ../ is enough to send the browser elsewhere. A personal computer path copied from a file explorer cannot serve visitors; replace it with a path inside the site.
Key Takeaways
- Relative paths start from the referring file;
../goes up one folder. - CSS image paths start from the style sheet, not the HTML page.
- A leading
/starts at the domain root and can skip a project subfolder. - Use forward slashes and exact letter case in paths.
- Trace a broken link through its full Network request URL.
1.3 Errors a browser can hide
Browsers try to display pages even when the code contains mistakes. That recovery is useful for visitors, but it can hide problems from the author. Validation checks HTML or CSS against the rules of its standard, independently of whether the page happens to look right.
Use the checker for the language
The W3C Nu Html Checker checks HTML. The W3C CSS Validation Service checks CSS. You can submit a published URL, upload a file or paste code. An editor's built-in checks are useful while writing; the web checkers also let you check the published copy.
Read the line and column attached to each message. An error breaks a rule and needs fixing. A warning or information message asks for attention but may describe allowed code. Read what it says before deciding whether a change is needed.
Work from the first error downward and rerun the checker after the fix. One missing quote or badly closed element can make later code appear to belong somewhere it does not, producing many follow-on messages.
Repair structure in HTML
Consider incorrectly nested elements:
<p>Open <strong>daily</p></strong>
The inner <strong> must close before the outer <p>:
<p>Open <strong>daily</strong></p>
For a meaningful photo, supply an alt attribute describing its relevant content, such as alt="Mechanic adjusting the brakes of a city bike". A decorative image uses an empty alt="". Each id must also be unique within its page. Use a shared class when several elements need the same style.
Other useful checks include the doctype, a page title, complete attribute quotes and list items inside a list. A <div> cannot sit inside a paragraph. The browser closes that paragraph before the division, and a later </p> can become a stray closing tag. The corrected browser structure can differ from the text you wrote.
Repair declarations in CSS
A number and its CSS unit belong together: write width: 100px;, with no space between 100 and px. The property for text color is color. An unknown property is ignored.
A missing semicolon can damage the next declaration too:
.card {
margin: 10px
padding: 5px;
}
The browser reads the two lines as one invalid declaration. Add the missing semicolon after 10px, then check again. Browsers usually skip invalid declarations without displaying an on-page error.
Combine code checks with page checks
Passing validation does not establish that the page is accessible, fast, useful or factually correct. Try keyboard navigation, examine the layout in browsers and check the content itself. If the CSS checker flags a very new feature, check its specification and MDN support information before removing working code; checkers can lag behind newer features.
Validate after substantial changes and before publishing. After upload, submit the live address and verify that the latest content is visible. A valid older page can pass just as easily as the updated one.
Key Takeaways
- Validate HTML and CSS with their separate checkers.
- Fix the earliest error and rerun before chasing later messages.
- Browsers repair HTML and skip invalid CSS, so appearance alone can hide errors.
- Read warnings and decide whether they identify a real problem.
- Check accessibility, behavior and the live version alongside validation.
2Find the cause with browser tools
A browser can show you the structure it built, the styles it selected and every file it requested. These clues turn a vague problem such as "the page looks wrong" into something you can test. Use Elements to inspect the affected item, Console and Network to check loading problems, and a repeatable process to isolate a cause. Save a successful fix in your source files and test it in other browsers and screen sizes.
2.1 See which CSS actually wins
Developer tools, often called DevTools, show how the browser interprets your page. Right-click an item and choose Inspect. You can also use F12 or Ctrl+Shift+I on Windows and Linux, or Cmd+Option+I on macOS. In Safari, first enable "Show features for web developers" in Settings, Advanced.
Inspect the browser's structure
The Elements panel, called Inspector in Firefox, shows the DOM: the structure built from the HTML. The browser may have repaired invalid markup, so this is not always a direct copy of the source. A <div> written inside a paragraph appears outside it in the DOM because the browser ends the paragraph first.
Select the item with the problem. The Styles pane lists matching CSS rules and links to their source files and line numbers. A crossed-out declaration is not active. Another rule may beat it, or a warning icon may show that the declaration is invalid. The Computed pane shows the final property values after the browser has resolved those rules.
Follow a losing color rule
Suppose this link appears navy even though its button class asks for white:
<a class="btn" href="contact.html">Contact us</a>
#main a { color: navy; }
.btn { color: white; }
Both rules match when the link is inside id="main". The id selector makes #main a more specific: its specificity is (1, 0, 1), compared with (0, 1, 0) for .btn. In these ordinary rules, putting .btn later does not overcome that difference.
One targeted fix is #main .btn, with specificity (1, 1, 0). Another is replacing the broad id rule with a link class such as .nav-link. Two single-class selectors have equal specificity, so their order can decide the color. Changing #main a to .main a still leaves (0, 1, 1), which beats .btn. Inspect the actual winner before choosing the smallest useful correction.
Measure the whole box
The box model diagram separates content, padding, border and margin. With box-sizing: content-box, a 300px content width plus 20px padding on each side and 2px borders takes:
That is a 344px border box, before any margins. With box-sizing: border-box, the whole border box stays 300px wide; its content width becomes:
Use the diagram to explain a gap or overflow instead of repeatedly changing widths by guesswork. Flexbox and grid badges can also show layout tracks, lines and gaps.
Try a change, then save it
Toggle a declaration off, edit a value or add a rule in Styles. Force :hover or :focus to examine a state without keeping the pointer or keyboard in place. These edits are temporary: ordinary DevTools editing does not update your project files. Copy the working change into the source, save and reload. If the fix disappears, it has not yet been saved in the copy the browser loads.
Key Takeaways
- Elements shows the browser-built DOM; Styles shows matching rules; Computed shows final values.
- Trace a crossed-out declaration to the rule or invalid value that prevents it from applying.
- Inspect content, padding and border together when diagnosing widths.
- Copy tested DevTools changes into the source and reload to verify them.
2.2 Read failed requests and stale files
A page is assembled from several requests. The HTML can arrive successfully while a style sheet or image fails. Console messages and the Network panel show these separate outcomes.
Open the tools before reloading
The Console reports errors and warnings, including script failures, missing resources and mixed content. Messages often link to the affected file and line. Even an HTML-and-CSS site can have useful Console messages.
The Network panel records the page's requests while DevTools is open. Open it, reload, then filter by CSS, images or fonts to reduce the list. Read the requested URL, status, type, size and time. Select an entry to inspect its response headers and contents.
| Status | Meaning | What to check |
|---|---|---|
200 | OK; a response was sent | Whether it is the intended file and type |
301 or 308 | Permanent redirect | The destination address |
304 | Not modified | The saved copy is being reused |
404 | Not found | Path, case and uploaded file |
5xx | Server problem | Host status and server response |
A status in the 400s concerns the request; one in the 500s concerns the server. A 404 is not evidence that you need to change the CSS layout.
Trace a missing logo
The live page has an empty image space. In Network, its request is https://www.example.com/images/Logo.svg, returning 404. The uploaded file is images/logo.svg. The requested capital L does not match the actual lowercase name. Correct the HTML path, deploy the page, and confirm the request now succeeds.
Trace an unstyled page
Look for the CSS request first. If no request appears, inspect the <link> element, including rel="stylesheet". If the request is 404, compare its URL with the uploaded location.
A 200 is only a successful response, not confirmation that the response is CSS. Check the Console and the response's Content-Type, which should be text/css. A host can mistakenly return an HTML error page with 200 status, and the browser will refuse to apply it as a style sheet. Once the correct CSS has arrived with the right type, inspect invalid declarations and selectors that do not match the affected element.
Rule out the browser's saved copy
A cache stores files for reuse. It saves download time, but an old copy can make a successful update look missing. With DevTools open, enable "Disable cache" in Network and reload. In Chrome, Edge and Firefox, Ctrl+Shift+R on Windows and Linux or Cmd+Shift+R on macOS forces a full reload. Inspect the returned content before concluding that the upload failed.
The size and timing columns also help with speed problems. A 3.6 MB image among tiny text files is a useful starting point. Network throttling simulates a slower connection. An HTTPS page that requests a file with http:// can trigger a mixed-content warning; inspect the exact resource URL to find the insecure reference.
Key Takeaways
- Open Network before reloading so it records the requests you need.
- A 404 calls for a path and upload check; a 200 still needs the correct response contents and type.
- Use Console messages and response headers together to diagnose refused CSS.
- Disable the cache when checking whether a new version arrived.
- Network size and timing columns reveal heavy or slow resources.
2.3 A fix you can repeat and trust
A useful bug report describes an observable difference: "At 360px wide, the contact page scrolls sideways." That is easier to investigate than "the mobile layout is broken." Record the page address, browser, screen width, actual result and expected result.
Follow evidence through five steps
- Reproduce. Make the problem happen again in the same conditions.
- Gather evidence. Read Console and Network, validate the code, and inspect the affected element.
- Isolate. Disable one rule or temporarily remove a small piece of code to narrow the cause.
- Change one thing. Test whether that change explains the result.
- Save and retest. Put the fix in the source, reload and check other conditions.
Changing several things at once makes the result hard to interpret. One change may solve the original issue while another creates a new one. Keep the failing case available so you can compare before and after.
Work through a narrow-screen overflow
A page fits on a laptop but scrolls sideways at a 360px viewport. Open responsive mode at that width. Hover over elements in Elements and watch their highlighted boxes. An image is wider than its column; its HTML gives a large intrinsic width, and no CSS limits it.
Try this rule:
img {
max-width: 100%;
height: auto;
}
The maximum width lets the image shrink to its container. Automatic height preserves its proportions. If the overflow disappears, save that rule in the correct style sheet and reload. Then test the image at wider widths too. Hiding horizontal overflow on the page could conceal part of the image without making it fit.
If the change does nothing, use the evidence to narrow the next step. Does the rule appear in Styles? Is it overridden? Did the browser load the file you edited? Common causes include mismatched class names, incorrect paths, missing braces or semicolons, unsaved files and cached copies.
Test engines as well as window sizes
Responsive mode changes viewport width and can simulate touch, but it does not reproduce every detail of a real phone's speed, fonts or rendering. Check the media-query breakpoints and the widths between them, then use at least one real phone.
Chrome and Edge use Blink, Firefox uses Gecko, and Safari uses WebKit. Two browsers using the same engine do not provide the same breadth of testing as browsers using different engines. Safari is particularly relevant for the many iPhone browsers that use WebKit. Check MDN's support information before relying on a newer feature.
Check the published version
Server behavior can expose failures hidden on disk: case-sensitive names, missing uploads and paths that skip a project subfolder. Open the live address, follow the links and inspect failed requests there.
Before publishing, validate the HTML and CSS, inspect Console errors, check for unintended 404s, try phone, tablet and desktop widths, and check at least two browser engines. Use the keyboard to follow navigation and activate controls. After deployment, repeat the checks on the live site where the changed feature is used.
Key Takeaways
- Describe a reproducible problem with its address, browser and viewport.
- Isolate a cause and change one thing at a time.
- Test different browser engines and a real phone alongside responsive mode.
- Check both the saved source and the published version.
- Include links and keyboard navigation in launch checks.
3Make pages fast and stable
Large images often account for most of a small site's download. Preparing the files saves data; good image markup then helps the browser choose a suitable file and reserve its space. Measure the page to find the largest remaining delays and unexpected shifts. Use Network, Lighthouse and real-visitor data to decide what to improve, keeping the visitor's screen, connection and device in view.
3.1 Smaller image files with enough detail
An optimized image is a small file that still looks good at its displayed size. Start with the format, pixel dimensions and compression. Shrinking an oversized photo with CSS changes its appearance, but the browser still downloads and decodes the original file.
Match the format to the content
| Format | Useful choice for | Main property |
|---|---|---|
| JPEG | Photos | Lossy compression; no transparency |
| PNG | Screenshots, sharp graphics | Lossless; supports transparency |
| WebP or AVIF | Photos and other raster graphics | Modern lossy or lossless formats; transparency |
| GIF | Existing simple animations | Limited to 256 colors per frame |
| SVG | Logos, icons, simple drawings | Vector shapes that stay sharp when scaled |
Raster images store pixels. Enlarging a small raster image reveals blur because no extra detail is created. SVG stores shapes and lines, so it suits a logo but not a camera photo. Current major browsers support WebP and AVIF. For animation, a modern image format or short video often makes a smaller file than GIF.
Lossless compression preserves pixel values. Lossy compression removes some detail to save more bytes. Lower quality eventually produces blocky areas or blurred edges. Compare the export at its actual displayed size. Make each new export from the original, avoiding repeated lossy saves of an already compressed copy.
Resize for the largest use
A photo displayed at most 800 CSS pixels wide needs about 800 image pixels on a standard-density screen and 1,600 on a screen using two device pixels per CSS pixel. Prepare suitable alternatives instead of sending the camera original to everyone.
The bike shop's original is 4,000 × 3,000 pixels and 3.6 MB. A 1,600 × 1,200 export has:
pixels, or 16% of the original 12 million. A JPEG export at quality 80 might be about 240 KB; the actual size depends on the photo. That example saves about 93% of the file bytes.
At 10 Mbit/s, using decimal MB, the original's ideal transfer time is:
seconds. The 0.24 MB export takes about 0.19 seconds. These are transfer times only; real loading also includes connection and server delays. Decoded at 4 bytes per pixel, memory use drops from 48 MB to 7.68 MB. A smaller encoded file and fewer decoded pixels are separate gains.
Export a public copy
Use an image editor's export controls or a tool such as Squoosh. Keep the original outside the published folder and give the exports clear names such as workshop-800.jpg and workshop-1600.jpg. Strip camera metadata during export; it can include the photo's date, camera details and GPS location.
For an SVG, an optimizer such as SVGO removes drawing-program leftovers. Text compression on the server can reduce its transfer size further. For any format, inspect the finished image: a photo saved as PNG can be unnecessarily large, while a text-heavy logo saved as JPEG can have smeared edges.
Key Takeaways
- Choose a format for the image content: photos need raster formats; simple logos often suit SVG.
- Resize the actual file for its display size and screen density.
- Compare lossy exports at their displayed size and export from the original.
- Remove unnecessary metadata from public image copies.
- Pixel dimensions affect decoded memory as well as download size.
- CSS scaling alone does not reduce the downloaded image file.
3.2 Images that fit without pushing text around
An image can be small enough to download quickly yet still make a page jump. The browser needs to know its proportions before the image arrives and needs useful choices for different screens.
Reserve space with dimensions
Write numeric width and height attributes without units:
<img src="images/workshop-800.jpg"
width="800" height="600"
alt="Mechanic adjusting the brakes of a city bike">
These dimensions tell the browser the 4:3 aspect ratio. With max-width: 100%; height: auto; in CSS, the image shrinks to fit a narrow column. In a 360px-wide column, its height is:
pixels. Reserving that space keeps the text below from moving down when the image loads. Missing dimensions can produce layout shifts, the unexpected movements measured by CLS.
Offer widths the browser can choose
For the same photo at two sizes, use width descriptors and a description of its display width:
<img src="images/workshop-800.jpg"
srcset="images/workshop-800.jpg 800w,
images/workshop-1600.jpg 1600w"
sizes="(max-width: 840px) 100vw, 800px"
width="800" height="600"
alt="Mechanic adjusting the brakes of a city bike">
800w and 1600w state the actual file widths. In this layout, sizes says the image occupies the viewport width up to 840px and 800px above that. The browser uses the declared slot width, screen density and its selection rules to choose a file. Make sizes match the real layout; a full-viewport claim for a much narrower column can cause unnecessary downloads.
Offer formats with a fallback
<picture>
<source srcset="images/workshop.avif" type="image/avif">
<source srcset="images/workshop.webp" type="image/webp">
<img src="images/workshop.jpg" width="800" height="600"
alt="Mechanic adjusting the brakes of a city bike">
</picture>
The browser chooses the first supported source format. The required <img> supplies the fallback, dimensions and alternative text. This is a format choice; srcset with width descriptors solves the related problem of choosing a suitable pixel width.
Delay images that are not needed yet
Use loading="lazy" for images farther down a page. The browser can wait until the visitor gets near them, saving data for images never reached. Keep images visible at first load eager, especially the large main hero image. Lazy loading that image delays the content visitors are waiting to see. A hero in the HTML is discovered early; fetchpriority="high" can request higher fetch priority for it.
Write alt text for the image's purpose in context. A decorative image gets alt="". Meaningful photos and diagrams belong in HTML as images; a CSS background suits decoration and has no alt attribute or native loading attribute.
Key Takeaways
- Correct width and height attributes reserve the image aspect ratio before loading.
- Use
srcsetand accuratesizesto offer suitable image widths. - Use
<picture>sources for format choices and keep the required fallback<img>. - Lazy-load below-the-fold images, keeping first-screen and hero images eager.
- Place meaningful images in HTML with useful alternative text.
3.3 Measure what visitors wait for
Page weight is the total data downloaded for a page. The HTML leads to requests for CSS, images, scripts and fonts. File sizes, request count, connection speed and device performance all contribute to the experience.
Find the largest share
The bike shop home page downloads 15 KB of HTML, 30 KB of CSS, two 40 KB fonts, a 2,400 KB hero and three 350 KB photos:
KB. Images account for 3,450 KB, about 96.5%. With a 220 KB hero and three 45 KB photos, the total becomes:
KB, about 87% less. At 10 Mbit/s, ideal transfer time drops from about 2.86 seconds to 0.38 seconds. Server response and connection setup add time. Removing a few spaces from CSS would have little effect beside this image saving.
Read the experience measures
The Core Web Vitals, as of October 2026, measure different problems:
| Measure | What it tracks | Good threshold |
|---|---|---|
| LCP: Largest Contentful Paint | When the largest visible image or text block appears | 2.5 seconds or less |
| INP: Interaction to Next Paint | Delay from interaction to the next visible response | 200 milliseconds or less |
| CLS: Cumulative Layout Shift | Unexpected movement over the page's lifetime | 0.1 or less |
Good field performance meets each threshold at the 75th percentile. CLS can include a banner shifting content after loading, not just an image arriving during initial load.
Lighthouse in Chrome or Edge runs a lab test with scores and suggested fixes. PageSpeed Insights runs online tests and, when enough observations exist, shows field data from real Chrome visits. A lab score is one test under chosen conditions. Repeat comparisons with the same settings and look at real visits when available.
Improve the biggest costs first
Prepare images and their markup first. Then reduce unnecessary font families and weights, use WOFF2 fonts, and use font-display: swap so fallback text appears while the font loads. Add defer to suitable external scripts so downloading does not block HTML parsing and execution follows parsing. Large maps, video players and other third-party embeds can be loaded on demand.
Minification removes spaces and comments from code. gzip or Brotli compression reduces transferred text bytes. These help, but already compressed JPEG, WebP and AVIF images gain little from further text-style compression.
Caching lets returning visitors reuse files, controlled through headers such as Cache-Control. A CDN keeps copies in different regions to reduce the distance requests travel. When a long-cached resource changes, a name such as styles-v2.css or address such as styles.css?v=2 makes it a new request. Test under network throttling and on a phone; a quick laptop on Wi-Fi can hide a slow mobile experience.
Key Takeaways
- Use page weight and request timings to choose the largest useful improvement.
- LCP, INP and CLS track loading, responsiveness and visual stability.
- Compare lab tests under matching settings; field data reflects real visits.
- Optimize images before small text-file savings when images dominate.
- Keep fonts, scripts and third-party embeds light.
- Caching and CDNs speed delivery; changed long-cached files need a new address.
4Make pages clear to search engines
Search engines discover pages through links and read their content to understand them. A useful page title, an honest description and a clear heading outline give each page a recognizable purpose. Crawling and indexing controls then help guide which public pages are found and shown. Learn the different jobs of links, robots.txt, noindex, sitemaps and canonical URLs so one setting does not accidentally defeat another.
4.1 Titles, descriptions and a readable outline
Each page should explain its own purpose in its HTML. Search engines read that markup, while browser tabs, bookmarks and screen readers also depend on it. Clear structure begins with the content visitors can actually read.
Name the page in the head
The <title> element belongs in <head>. Give each page its own descriptive title, with the site name after the specific topic:
<title>Repair Prices – Riverside Bike Repair</title>
<meta name="description"
content="Prices for flat repairs, brake adjustments and full services at Riverside Bike Repair. Walk in Monday to Saturday or book online.">
The title appears in the browser tab and bookmarks and usually contributes the headline in search results. HTML does not impose a title length limit, but search displays cut text to fit, so put the useful words first. A generic title such as "Home" gives little information when separated from the site.
The meta description is a readable one- or two-sentence page summary. Search engines may use it for a result's snippet, but they can select page text instead. Match the description to that page's content. Copying one description across every page hides the differences between them; a list of repeated keywords is not a useful summary. Google ignores the old keywords meta tag.
Declare language and characters
Use <html lang="en"> for an English page. It helps screen readers choose pronunciation and browsers handle language features. Google identifies language from visible text and ignores this attribute, so do not treat it as a Google language-setting switch.
Place <meta charset="utf-8"> early in the head so characters such as é and an en dash display correctly. Include the viewport meta tag used for responsive pages:
<meta name="viewport" content="width=device-width, initial-scale=1">
Make the outline match the ideas
Use one clear <h1> for the main page topic, <h2> for its main sections and <h3> for subsections. On the prices page, "Services" is an h2, with "Basic service" and "Full service" as h3 headings beneath it. Choose heading levels for this relationship; adjust their visual sizes with CSS.
Semantic elements identify roles: <nav> for navigation, <main> for the main content, and appropriate <header>, <article>, <section> and <footer> elements. Use actual lists, links for navigation and buttons for actions. A page of generic divisions loses these role signals. Keep important words such as prices, opening hours and headings in HTML text, where they are available as text to visitors and tools.
Set a useful shared-link preview
Open Graph tags describe a link preview in social and chat apps. Common properties are og:title, og:description and og:image:
<meta property="og:title" content="Repair Prices">
<meta property="og:image"
content="https://www.example.com/images/workshop-800.jpg">
Use a full HTTPS URL for the preview image. These tags describe the shared card; they do not replace the visible page headings or its ordinary title and description.
Key Takeaways
- Give every page a specific title and an honest, unique description.
- Use
langfor language-aware browsers and assistive technology. - Choose heading levels for the content outline and style their size with CSS.
- Semantic HTML and real page text make content easier to interpret.
- Open Graph tags supply shared-link preview details.
4.2 Discovery, indexing and preferred addresses
Crawling is fetching pages, often by following links. Indexing is storing information about those pages for search results.
Give every page a route in
Link each page from at least one other page with an ordinary <a href> link. Descriptive text such as "repair prices" tells visitors and crawlers what the target contains. A readable path such as /blog/winter-checklist.html gives more context than /page7.html.
A sitemap lists the full preferred URLs you want discovered. An XML entry can look like this:
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://www.example.com/prices.html</loc>
<lastmod>2026-10-01</lastmod>
</url>
</urlset>
The optional last-modified date should represent a significant change. Update the sitemap as pages change. A small, well-linked site can be discovered without a sitemap.
Keep crawling and indexing controls distinct
A robots.txt file at the domain root asks compliant crawlers which paths not to fetch:
User-agent: *
Disallow: /drafts/
Sitemap: https://www.example.com/sitemap.xml
This does not lock the folder. People can open its addresses, and a blocked URL may still appear in results if other pages link to it. Without a robots.txt file, crawlers are allowed to fetch pages. A copied Disallow: / blocks crawling across the site, so remove a test-site block before launch when the site should be crawled.
To request exclusion from search results, put this in the page's head:
<meta name="robots" content="noindex">
The crawler must fetch the page to read that instruction. Blocking the same URL in robots.txt can stop it from discovering noindex. Neither setting makes a page private: private content needs access control or must stay off the public site.
Choose one address for duplicate content
A page may answer at HTTP and HTTPS addresses, with and without www, or at both /blog/ and /blog/index.html. A canonical link identifies the preferred address:
<link rel="canonical" href="https://www.example.com/blog/">
Use the full absolute URL. Canonical markup is a strong hint; a redirect that actually sends visitors to the preferred address is a stronger signal. Match internal links and sitemap URLs to that preference to avoid sending conflicting signals.
Check what search engines can see
Google Search Console and Bing Webmaster Tools accept sitemaps and show indexing and crawl problems after you verify site control. A site:example.com search gives a rough view of indexed pages. New sites may take days or weeks to appear. A sitemap, clean markup or a payment cannot guarantee a high ranking; these tools help you find technical obstacles and understand what has been processed.
Key Takeaways
- Crawling fetches a page; indexing makes its content available for search.
- Link every page with useful link text and list preferred URLs in a sitemap.
robots.txtcontrols crawling requests, whilenoindexrequests exclusion from results.- A crawler needs access to read a page-level
noindextag. - Canonical links suggest a preferred URL; redirects send visitors there.
- Use webmaster tools to inspect discovery and indexing problems.
5Publish and update a static site
Static hosting serves the HTML, CSS and other files you have prepared. Choose a service whose publishing method, limits and features fit the site you need to run. Then deploy the correct folder, check the host's live address and follow a controlled route for later changes. A successful upload is the start of the live check: missing assets, old content and broken addresses still need to be caught.
5.1 Choose hosting for the site you have
A static website serves prepared HTML, CSS, image and script files. Its content can be updated whenever you publish new files; "static" describes how the host serves them. The hosting server keeps delivering them when your own computer is switched off.
Know what the host provides
A dynamic site builds responses on the server, often from a database. A small informational site or portfolio built with HTML and CSS can use static hosting without server-side programming. Adding a contact form's markup does not by itself create a service that stores or emails submissions. That requires host-provided form handling or a separate service.
Static hosts commonly provide a temporary address, publishing controls and HTTPS. Many serve files through a content delivery network, which keeps regional copies. GitHub Pages, Netlify, Cloudflare Pages and Vercel are examples, with different plan terms and workflows. Shared hosting is another option and often supports secure file transfer.
A static page can still run JavaScript in the visitor's browser, such as a menu interaction. The host still serves a prepared script file. With no site application code or database running on the server, there are fewer application components to attack; the hosting account and public files still need protection.
A GitHub Pages user site uses the root address https://username.github.io/ from a repository named username.github.io. A project site uses a subfolder such as /riverside-bikes/. That address structure matters when testing root-relative asset paths.
Compare needs with the current plan
Read the plan's limits and conditions before choosing. Check:
- Storage and monthly data-transfer allowances.
- Whether the plan permits commercial use.
- Custom-domain support and automatic HTTPS.
- A publishing method you can use reliably.
- Custom error pages, redirects and previous-deploy recovery.
- Form handling if visitors must submit information.
- How easily you can take your files to another host.
A photographer's six-page portfolio with 40 prepared photos fits the size of many free static plans. If it attracts paid work, however, its commercial purpose also matters. Size alone does not establish that a free plan permits it. Terms change, so check the actual service and plan rather than relying on an old comparison.
Pick a manageable publishing route
Drag-and-drop publishing can suit a small project: you upload the folder through the host's interface. A repository connection publishes from a chosen stored code source and can deploy updates when changes are pushed. Command-line tools offer another route. Shared hosting often supports SFTP, an encrypted file-transfer method. Plain FTP exposes credentials and files during transfer, so use a secure route.
For GitHub Pages on a free plan, publishing is available from public repositories. Anyone can read the repository files. Published assets are public too, even when navigation does not link to them. Keep the upload limited to intended public files and protect the hosting account with two-factor authentication.
Check a feature in its actual workflow
If the site includes a contact form, locate the form endpoint or host feature that receives it. Confirm the plan includes that feature and send a test submission after launch. A form that looks complete can still have nowhere to send data. If a custom 404 page or permanent redirect matters, confirm the host's exact configuration method before depending on it.
Key Takeaways
- Static hosts serve prepared files and keep them available independently of your computer.
- Check current plan limits, commercial-use rules and needed features.
- A working contact form needs a receiving service beyond its HTML.
- Choose a publishing route you can maintain and secure the hosting account.
5.2 Deploy the right folder and verify it live
To deploy is to publish the current site files to a host. The publish directory becomes the site's root online. For plain HTML and CSS, there is no build step: select the folder containing the finished index.html and its assets.
Make the first release
For a drag-and-drop host:
- Open the folder you intend to publish and confirm that
index.htmlis directly inside it. - Validate the pages and test their links and layout through a local server.
- Upload that folder using the host's publishing interface.
- Wait until the host reports the deployment is live.
- Open its supplied web address and check the site there.
If the home page appears only at /riverside-bikes/index.html, you may have uploaded the containing folder one level too high. The intended publish directory is riverside-bikes/, not the folder holding it. Fix the directory selection and publish again; merely linking visitors to the nested address leaves the bare home address wrong.
Publish from a repository
In GitHub Pages, open the repository's Settings and Pages. Choose "Deploy from a branch", then select the branch and publishing folder, either its root or /docs, and save. When a new version is pushed to that publishing source, Pages deploys it again. Check the displayed Pages address after the deployment finishes. A project URL may include the repository name, so test paths at that actual location.
Other hosts have their own repository connection and directory settings. For a site made from plain files, do not add a build command simply because the interface offers a field for one.
Check the delivered version
Open every page, follow internal links and inspect Console and Network for failed resources. Force a full reload to avoid mistaking cached files for the new release. Try the site on a real phone. Check the visible change you intended to publish, not just the absence of an error message.
Configure a custom 404.html where the host supports it. It should tell the visitor that the address was not found and provide a useful way home. Check an invented missing address to verify the host actually uses it. A helpful error page does not replace a redirect when the content has moved.
Keep a source you can recover
The local project or connected repository is the source of truth, the copy from which future releases are made. A quick correction in a host's web editor can disappear on the next upload unless you also put it into that source.
Use a preview deployment when available to test an update before visitors receive it. If an update breaks the live site, a host's rollback can restore a previous deployment. Then correct the source too, or the next release may reintroduce the fault.
When a page changes address, add a permanent 301 redirect from the old URL to the new one using the host's redirect rules. Test the old address after publishing: it should lead to the intended new page. On Netlify, a _redirects file is one configuration route; other hosts use different settings.
Key Takeaways
- The publish directory has
index.htmldirectly at its top level. - Check the actual live address, asset requests and newest content after every deploy.
- Keep the local project or repository as the source for future releases.
- Preview updates and use rollback when a release needs recovery.
- Use a permanent redirect for a moved page; use a 404 page for a missing one.
6Connect a domain and keep the site running
A custom domain gives the site a lasting public name, but several services work together to make that name usable. Registration keeps your right to use it, DNS points it to the host, and HTTPS protects connections to the correct name. After launch, renewals, backups and regular checks keep those pieces working. Follow the connection through each service so a change to one does not quietly break another.
6.1 Register a name you can keep
A domain name is a readable name such as example.com. DNS connects that name to information such as a host's IP address. Registration gives you the right to use the name for a period; it is not a permanent purchase.
Read a web address
In https://www.example.com/prices.html, https is the scheme, www.example.com is the host name and /prices.html is the path. Read the domain labels from right to left: .com is the top-level domain, or TLD; example is the registered name under it; www is a subdomain.
Generic TLDs include .com, .org, .net, .dev, .shop and .studio. Country-code TLDs use two letters, such as .de, .fr, .jp, .ca and .au. Some names are registered under a second-level category, such as .co.uk.
Some endings have eligibility rules. .ca requires a Canadian connection; .eu accepts eligible EU or EEA citizens, residents and established organizations; .us requires a US connection. Check the registry's rules before choosing a restricted ending. The .dev and .app endings require HTTPS in browsers.
Know who handles registration
A registrar records your registration with the registry that operates the TLD. ICANN coordinates the generic TLD system and accredits its registrars; country-code registries set their own rules. Registrations commonly last from one to ten years and need renewal.
Choose a name that is short, easy to say and spell, and close to the project or business name. Avoid confusing numbers and hyphens, and check that the name does not use someone else's trademark. If a preferred .com name is taken, compare a clear longer name, a suitable local ending or a relevant generic ending. Availability alone is not permission to use another business's name.
Compare the ongoing commitment
Check the renewal price as well as the first year's offer. Extra services, including email, may have separate charges. The domain and the website hosting can come from different companies; registering a domain does not by itself upload a website.
Provide accurate owner and contact information and respond to the registrar's verification email. Unconfirmed contact details can lead to suspension. For generic TLD registration information, RDAP became the definitive public lookup route in January 2025, replacing the older WHOIS service requirements. Public lookup commonly hides personal details; the registrar still needs accurate records.
Keep control with the owner
The project or business owner should control the registrant account, even when a designer builds the site. Enable two-factor authentication and keep recovery details current. To change registrars, follow the transfer process, including a transfer code and unlocking the domain when eligible.
Record the expiry date, enable renewal and keep the payment method valid. An expired registration can interrupt the website and domain email; after applicable grace and deletion periods, another person may register the name. Hosting backups cannot preserve a domain registration you let lapse.
Key Takeaways
- A domain, hosting service and page path perform different jobs.
- Choose an eligible TLD and compare renewal costs as well as introductory offers.
- A registrar manages the registration through the TLD registry.
- Keep registration details accurate and the owner in control of the account.
- Renew the domain and maintain account recovery and payment details.
6.2 Point the right name at the right host
The Domain Name System, or DNS, stores records for names. A resolver looks up those records, often keeping a cached answer. The authoritative nameservers are the servers responsible for the domain's DNS information. Make changes at the provider whose nameservers actually serve the domain.
Choose the record type
| Type | Record's job | Example value |
|---|---|---|
| A | Name to IPv4 address | 192.0.2.44 |
| AAAA | Name to IPv6 address | 2001:db8::44 |
| CNAME | Name to another host name | riverside-bikes.pages.example |
| TXT | Text, often verification | A service's verification token |
| MX | Email receiving server | A mail server name |
| NS | Nameserver | A DNS server name |
The IP addresses and .example name here are documentation values. For a real connection, use the values supplied by your host for your site.
The apex is the registered root name, such as example.com. Standard DNS does not permit a CNAME there because the apex also needs other records, including NS. Use the host's A and AAAA values, or a provider-supported ALIAS, ANAME or CNAME-flattening feature. A subdomain such as www commonly uses a CNAME.
Connect two forms of an address
Suppose a host asks for an apex A record and a www CNAME. A provider that uses @ for the apex might show:
Type Name Value TTL
A @ 192.0.2.44 3600
CNAME www riverside-bikes.pages.example 3600
Enter the custom domain in the hosting settings too. The host must recognize the requested name and assign it to the site. Choose the main address and configure the other form to redirect to it.
Read the provider's name-field instructions. If it automatically adds example.com, typing www.example.com may create www.example.com.example.com. Remove obsolete address records when replacing a host; leaving both old and new values can send visitors to different servers.
Allow cached answers to expire
TTL, time to live, states how many seconds a DNS answer may be cached. A TTL of 3,600 is one hour; 86,400 is 24 hours. After an update, different visitors can temporarily receive different answers. Changes may take 24 hours or longer to be seen everywhere.
For a planned move, lower the TTL to 300 seconds at least one old TTL period before switching. Lowering it at the moment of the switch cannot shorten the lifetime of an answer already cached under the old TTL.
Move DNS without losing other services
You can leave DNS with the registrar and edit records, or change nameservers to a new provider. A nameserver change does not copy records. Recreate and check the required MX, TXT and other records at the new provider before switching, especially when domain email already works.
Check answers with nslookup www.example.com, dig example.com A +short or a DNS lookup service, and compare them with the host's settings. Add wildcard records only deliberately and where the host supports them. When removing a hosted site, remove DNS records pointing to it too; a forgotten alias may allow another person to claim the abandoned host target.
Key Takeaways
- Edit records at the authoritative DNS provider.
- A and AAAA point to IP addresses; CNAME points to another name.
- The apex needs A/AAAA records or a supported alias-style feature, not a standard CNAME.
- TTL controls cached answers; lower it ahead of a planned move.
- Recreate all required records before changing nameservers.
- Configure the custom domain at the host and remove obsolete DNS targets.
6.3 HTTPS for the names visitors use
HTTPS sends HTTP over an encrypted TLS connection. It protects the privacy and integrity of data in transit and lets the browser authenticate the server for the requested domain. Plain HTTP exposes data to people who can observe the connection.
A certificate identifies the domain
A TLS certificate binds a domain name to a public key and is signed by a trusted certificate authority, or CA. It lists the names it covers and its expiry. If visitors use both example.com and www.example.com, the certificate coverage must include both names, even when one redirects to the other: the browser connects securely before receiving that redirect.
An HTTPS connection is not a judgment about the honesty of a business. A fraudulent site can obtain a certificate for a name it controls. The connection's protection and the site's trustworthiness are separate questions.
Let the host issue and renew it
Many static hosts automatically request a free certificate, often from Let's Encrypt, once DNS points to the host and the domain is configured. The CA checks control of the name, for example through a DNS record or a file fetched over the web. Issuance can take minutes to about a day.
As of October 2026, newly issued publicly trusted TLS server certificates have a maximum lifetime of 200 days under the rules effective March 15, 2026. The maximum becomes 100 days in March 2027 and 47 days in March 2029. Let's Encrypt's default classic certificates currently last 90 days, with shorter profiles also available. Automatic renewal avoids having to repeat this work manually.
For a 90-day example, a certificate issued on March 1, 2026 expires on May 30. Renewal with 30 days remaining would occur around April 30. The actual expiry and renewal status are available through the host or certificate details; do not assume a working domain registration also means the certificate is current.
Redirect to HTTPS and fix insecure assets
Turn on the host's HTTPS enforcement. It redirects http:// requests to the HTTPS address, commonly with status 301 or 308. Also choose one main host name, with or without www, and redirect the other to it.
Mixed content occurs when an HTTPS page requests a resource through http://. Browsers block insecure scripts, style sheets, frames and fonts. They try to upgrade some media requests to HTTPS, which fails if the source cannot serve it. Check Console messages and search the code for http://. Use relative paths for your own files and working HTTPS URLs for external resources.
HSTS, HTTP Strict Transport Security, tells browsers to use HTTPS for a set period. Enable it when HTTPS works reliably; browsers that have received the policy will not fall back to plain HTTP during that period. The .dev and .app endings are preloaded for HTTPS-only behavior.
If a certificate warning appears after connecting a domain, check DNS, issuance status and name coverage. The bare domain can work while www fails when only the bare name is covered. Correct the configuration and wait for issuance where needed; visitors should not bypass a certificate warning.
Key Takeaways
- HTTPS protects data in transit and authenticates the connection for the requested domain.
- Certificate coverage must include each HTTPS name visitors use.
- Keep automatic certificate renewal working; registration renewal is a separate task.
- Enforce HTTPS and replace insecure resource URLs to fix mixed content.
- Enable HSTS only after HTTPS works reliably.
- An encrypted connection does not establish that a site is honest.
6.4 A maintenance routine that catches failures
A live site changes even when its files do not. External links move, contact details become outdated, domains approach expiry and third-party widgets change. Maintenance keeps the content correct and the delivery reliable.
Follow the same route for every update
Edit the local project or repository, test in a browser, validate the affected code, deploy, and verify the live pages. Make a preview when the host supports one. Check a successful correction in the copy used for future releases so it cannot be lost in the next upload.
A content change deserves a content check too. Confirm dates, opening hours, prices and contact details against their current source. Give pages an owner or review date. Remove or replace information that no longer describes the service; an old event notice can mislead visitors even when every tag is valid.
Check links and visitor tasks
Link rot is the gradual failure of links as target pages move or disappear. Use a link checker such as the W3C Link Checker, then verify and repair the reported failures. When your own page moved, a redirect preserves old inbound links. For an external page, update the target or remove the link when no useful replacement exists.
Try real visitor tasks. Send a contact-form test and confirm it arrives. Follow navigation with a keyboard. Test a phone layout. An uptime check that receives a page cannot establish that a form or navigation works.
Keep recoverable copies
Back up the source and required assets in at least two places, such as a computer plus an external drive, cloud storage or repository. A hosting account problem or mistaken deployment can remove the live copy, so the live host is not your only backup. Version history can make earlier versions recoverable. Keep enough information to reconnect the domain and republish the site.
Protect renewals and account access
Enable domain auto-renewal and keep the payment method valid. Check the expiry date and confirmation messages. Make sure registrar and host accounts use two-factor authentication and current recovery details. Certificate renewal also depends on a working domain configuration, so check HTTPS after DNS changes.
An uptime monitor checks the site repeatedly and alerts you when it stops responding. Webmaster tools can reveal crawl failures and 404s from old addresses. Review those reports, then test the underlying problem rather than assuming every alert has the same cause.
Schedule work by the kind of change
| When | Useful checks |
|---|---|
| After each change | Validate, deploy, verify changed pages and resources live |
| Monthly | Check links, send a form test, review errors and run a quick speed test |
| Yearly | Confirm renewal and payment details; review every page, dependency and plan limit |
Third-party fonts, scripts, maps and other embeds may slow down, change or disappear independently of your site. Keep them few and review whether they are still needed. Where a license permits, hosting a local copy of an asset can reduce dependence on another server. Recheck its license and update needs when replacing it.
Key Takeaways
- Use a repeatable edit, test, validate, deploy and live-check routine.
- Review facts and visitor tasks as well as code and links.
- Keep recoverable source and assets in at least two places.
- Maintain domain renewal, certificate renewal and account recovery separately.
- Use monitoring and webmaster reports to find faults, then investigate their cause.
- Review third-party dependencies and plan limits as the site changes.
Publishing a Website examples
1Prepare a workshop site for upload
12 steps
- 1IntroductionMake the folder portable
Willow Workshop has a home page, an events page and a logo. The site looks right on its author's computer, but that is only a local result. The host needs a complete public folder, and every resource path must still work after that folder moves, so each path is written from the page that uses it.
You will prepare its layout, trace links from a nested page and repair markup that a browser might hide, errors you find when you validate the code.
- 2ExampleChoose the public folder
Use one folder named
willow-site/, withindex.htmldirectly inside it. Addevents/next.html,css/main.cssandimages/mark.svg.Keep the camera originals and planning notes in a separate folder outside it. The public folder should contain the files visitors need; an unlinked file is still downloadable if someone knows its address.
- 3ChallengeFind the upload risk
The author adds an unlinked contact list to
willow-site/for convenience. Does leaving it out of the navigation keep it private?---reveal---
No. A visitor can request the file directly if its address is known or guessed. Remove the private list from the folder before publishing; a missing navigation link does not control access to a file.
- 4ExplanationStart from the referring page
The home page and the nested events page begin in different folders. In
index.html,images/mark.svgreaches the logo. Fromevents/next.html, the same text would look insideevents/images/.Trace the route as folder moves:
../first leavesevents/, thenimages/mark.svgenters the correct folder. The complete path is../images/mark.svg. - 5ExampleWrite the nested page links
Inside
events/next.html, write:<a href="../index.html">Home</a> <link rel="stylesheet" href="../css/main.css">Both requests go up one level to the site root. A link to another page inside
events/, such aslater.html, needs only that file name. Always use forward slashes and match the uploaded names exactly, including letter case. - 6Key InsightCSS has its own starting folder
The style sheet
css/main.cssneedsimages/paper.svgas a background. Its URL starts fromcss/, even when the stylesheet is loaded by the nested events page.body { background-image: url("../images/paper.svg"); }Go up from
css/and down intoimages/. Changing the HTML page's depth does not change this external stylesheet's starting location. - 7ChallengeKeep a project subfolder in the route
The site is now previewed at
https://pages.example/willow-site/. Its home page links to/css/main.css. Where does that request go, and what relative path reaches the intended stylesheet?---reveal---
It requests
https://pages.example/css/main.css, skipping/willow-site/. Usecss/main.cssfrom the home page. The leading slash starts at the domain root, not at the project's folder. - 8ExplanationCheck what the browser repairs
Run the HTML through the W3C Nu Html Checker and CSS through the W3C CSS Validation Service. The page's appearance cannot reveal every error: browsers recover from malformed HTML and skip invalid CSS.
Start with the earliest error message, using its line and column. Fix it and check again before editing later messages that may be consequences of the first mistake.
- 9ExampleRepair the element nesting
The events page contains this fragment:
<p>Bring <strong>gloves</p></strong>strongbegins inside the paragraph, so close it before closing the paragraph:<p>Bring <strong>gloves</strong></p>Save the correction and rerun the checker. Inspect the surrounding messages again; one structural fix can remove several later complaints.
- 10ChallengeRepair a skipped CSS value
The checker flags
margin: 16 px;, and the intended spacing is missing. What should the declaration be, and why?---reveal---
Write
margin: 16px;. The number and unit must stay together as one length. The spaced value is invalid and can be ignored by the browser, so adding a second layout rule would leave the original cause in place. - 11ChallengeTrace a live failure
The local logo works. On the live events page, Network requests
/willow-site/events/images/Mark.svg, but the uploaded file is/willow-site/images/mark.svg. What two path corrections are needed?---reveal---
Use
../images/mark.svg: leave the events folder and match the lowercase file name. Then redeploy and inspect the live request. Both the starting folder and the case must be correct. - 12RecapFinish with checks that see different faults
Prepare the release folder, then test it through a local HTTP server so folder routes behave realistically. Validate the code and follow the actual page links. After upload, repeat the relevant checks at the live address and confirm the latest content.
If a resource fails, compare its requested URL with its uploaded location before changing unrelated layout code.
2Find why a page looks wrong
13 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionTurn a symptom into a test
- 2TipInspect the affected link
- 3ExampleRead the competing rules
- 4ChallengeMake the fix survive reload
- 5ExampleExplain a box wider than expected
- 6ExplanationRecord the resource requests
- 7ExampleAn HTML response at a CSS address
- 8ChallengeSeparate a stale view from a failed upload
- 9ExplanationNarrow the overflow cause
- 10ChallengeChoose a test you can interpret
- 11ConnectionUse devices and engines for different checks
- 12ChallengeCombine the evidence
- 13RecapVerify the saved correction
3Improve a gallery page step by step
15 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionFollow the largest delay
- 2ExplanationChoose the representation
- 3ExampleCalculate the useful export size
- 4TipCompare exports from the original
- 5ChallengeWhy the download did not shrink
- 6ExampleReserve the gallery image space
- 7ExplanationDescribe the slot honestly
- 8ConnectionFormats and widths solve different choices
- 9ChallengeChoose what may wait
- 10ExampleAdd the actual page bytes
- 11ExplanationMatch a symptom to a measure
- 12Key InsightA lab run is one kind of evidence
- 13TipAddress the next largest cost
- 14ChallengeChoose a complete next check
- 15RecapCompare the experience, then keep the improvement
4Help the right pages appear in search
11 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionSeparate understanding from discovery
- 2ExampleName the individual page
- 3ExplanationGive the outline a structure
- 4ChallengeRepair the copied template
- 5TipSet metadata for its real users
- 6ExplanationCreate a discoverable route
- 7ExampleKeep a public page out of results
- 8ChallengeExplain a blocked URL still showing
- 9Key InsightOne preferred route for a duplicate
- 10ChallengeCheck a launch with no search visits
- 11RecapCheck the intended page states
5Publish a site you can update
10 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionMove from local files to a live address
- 2ExplanationMatch the plan to the actual use
- 3ChallengeLook beyond file size
- 4ExampleSelect the release folder
- 5ExampleRelease and verify the same version
- 6ConnectionUse a repository as the publishing source
- 7ChallengeRecover the next release too
- 8TipPreserve a moved address
- 9ChallengeCatch two different launch faults
- 10RecapKeep the release source complete
6Connect a custom domain and maintain it
18 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionFollow the name through the services
- 2ExplanationRegister with lasting control
- 3ChallengeSeparate the name from the host
- 4ExplanationEdit where the answers come from
- 5ExampleAdd the requested address records
- 6Key InsightKeep record jobs distinct
- 7ChallengeMove DNS without losing email
- 8ExplanationPlan around cached answers
- 9ExplanationLet domain control unlock a certificate
- 10ExampleA redirect still needs TLS first
- 11ChallengeFix the insecure stylesheet
- 12TipKeep enforcement and renewal working
- 13ExplanationProtect the source beyond the host
- 14ChallengeTest what an uptime check misses
- 15ConnectionSchedule checks by their triggers
- 16ChallengeClose an abandoned route
- 17ChallengeInvestigate a partial domain launch
- 18RecapKeep a record you can use during an outage
Publishing a Website practice questions
Set 1: Diagnose requests and connect services10 Practice Questions
Question 1 of 10
Show answerHide answer
Question 2 of 10
Show answerHide answer
Question 3 of 10
Show answerHide answer
Question 4 of 10
home.html, css/ and images/. Its host expects the usual default home file. What should the home page be named?Show answerHide answer
index.html when the address ends in a folder or slash. Naming the page home.html does not make it that default file. Keep the default home page directly in the selected publish directory so the bare site address can open it.Question 5 of 10
content-box, width: 240px, padding: 12px and border: 3px solid. What is its border-box width, excluding margins?Show answerHide answer
content-box, the stated width covers only content. Add both side paddings and both side borders: 240 + 24 + 6 = 270px. The 255px result adds only one side of each, although the box has left and right padding and borders.Question 6 of 10
Show answerHide answer
Question 7 of 10
/public-site/index.html, but the bare host address gives an error. The uploaded parent folder contains public-site/, which contains index.html. What should change?Show answerHide answer
index.html directly. Publishing the parent added an unwanted path level. Renaming the containing folder cannot turn it into the home HTML file or change which directory the host serves.Question 8 of 10
Show answerHide answer
Question 9 of 10
example.com, but www.example.com gives a certificate-name warning before its redirect runs. Both names point to the intended host. What needs correction?Show answerHide answer
www.example.com before it can receive that name's redirect. The certificate therefore needs to cover www as well as the destination name. A redirect cannot repair missing name coverage after the secure connection has already failed.Question 10 of 10
Show answerHide answer
Set 2: Files, pages and first launch checks10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
news/update.html. The logo is at images/mark.svg in the site root. What relative image path reaches it?Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
https://pages.example/garden/. Its root page requests /css/main.css, but the style sheet is at https://pages.example/garden/css/main.css. What edit fixes the root page link?Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
id="content": #content a { color: green; } and, later, .action { color: white; }. What explains its green text?Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
width="1200" height="800" and scales proportionally to a 450px-wide column. How much height should the browser reserve?Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Set 3: Read the evidence before changing the site10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
padding: 18 px;. What is the correct syntax?Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
text/html. The page is unstyled. What should you fix first?Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
<h3> for every heading because its default size looks right. What change gives the content a clearer structure?Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
www to point to studio.pages.example. What standard DNS record represents that name-to-name relationship?Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Set 4: Plan updates without breaking working services10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
/field-notes/. Its css/main.css requests url("images/paper.svg"), but the image is at /field-notes/images/paper.svg. The same CSS is used by root and nested pages. What URL should the CSS use?Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
lang="en" and shows its prices only inside a photo. What change makes those prices available as ordinary page text?Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Set 5: Resolve launch and maintenance cases10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
opening-times.html is renamed to visit.html. The page content stays available, but old bookmarks fail. What preserves those old visits?Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
width: 100%; box-sizing: content-box; padding: 20px; border: 2px solid; causes sideways scrolling. The stylesheet loads correctly. What change and verification address the cause while retaining the padding?Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
/guide/ and /guide/index.html. It links internally to the second, lists the first in its sitemap, and has no canonical or redirect. What plan gives visitors and crawlers one consistent preferred route?Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
/docs, but the edited files are in the repository root. What should be corrected?Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Stuck on your own question? Homework Help
Key Terms
A
A record
AAAA record
Absolute URL
https://www.example.com/images/share.jpg so its host and location are explicit.Apex domain
Aspect ratio
Asset
B
Backup
Box model
Browser cache
C
Canonical URL
/guide/.Case sensitivity
Photo.jpg fails on a case-sensitive host when the uploaded file is photo.jpg.Certificate authority
Certificate renewal
CNAME record
www CNAME uses the host's site name rather than an IPv4 number or a URL path.Computed value
Console
Content delivery network
Content-Type
text/html Content-Type helps explain why the browser refuses it.Crawling
Cross-browser testing
Cumulative Layout Shift
D
Debugging
Default home page
index.html file inside it./news/ opens news/index.html when the host uses that default page convention.Deployment
Developer tools
DNS
DOM
Domain name
Dynamic website
F
Field data
File extension
main.css; renaming an unrelated text file does not make it CSS.Form handler
H
Heading hierarchy
Hero image
HSTS
HTTP status code
HTTPS
HTTPS enforcement
I
Indexing
Interaction to Next Paint
L
Lab data
Language attribute
lang="en" so a screen reader can choose an English pronunciation for its content.Largest Contentful Paint
Lazy loading
Link rot
Local development server
python3 -m http.server in the site folder makes it possible to test the project through HTTP.Lossless compression
Lossy compression
M
Maintenance
Meta description
Metadata
Minification
Mixed content
MX record
N
Nameserver
Network panel
Network throttling
noindex
O
Open Graph
P
Page title
Page weight
Parent directory
../ moves one level upward toward it.css/ reaches the root image folder through ../images/background.svg.Permanent redirect
/classes.html to the new /learn/ page.picture element
Pixel dimensions
Preview deployment
Publish directory
R
Raster image
RDAP
Registrant
Registrar
Registry
Relative path
news/update.html, ../images/icon.svg goes up to the root and then into the images folder.Rendering engine
Responsive mode
robots.txt
Disallow: / line asks crawlers to skip the site even though visitors can still open it.Rollback
Root-relative path
/ and locates a resource from the domain root, regardless of the current page's folder./club/, /css/main.css requests a different location from /club/css/main.css.S
Semantic HTML
SFTP
Site root
public-site/, so that folder is the site root for this deployment.Sitemap
sizes
sizes attribute describes an image's displayed slot width under different conditions when srcset uses width descriptors.Source of truth
Specificity
.action color loses to #main a in an ordinary rule conflict because its specificity is lower.srcset
srcset attribute offers image candidates, with descriptors such as actual pixel widths, from which the browser selects a resource.Static hosting
Styles pane
Subdomain
www subdomain points to the same website while a redirect selects the preferred public address.T
Third-party dependency
TLS certificate
Top-level domain
Transfer compression
TTL
Two-factor authentication
TXT record
U
Uptime monitor
V
Validation
Validation error
Validation warning
Vector image
W
Webmaster tools
#
404 Not Found
About this lesson
Make your own Study Materials
Turn your notes, slides and documents into Study Guides, Practice Questions, Flashcards and 6 more tools.