Search Engine Optimization (SEO)
HTML Living Standard
How do people find a web page through Google? Learn how search works and what you can do when writing your page’s content, headings, links, and metadata.
On this page
What is SEO?
Search Engine Optimization (SEO) means improving a website so people can find it more easily through unpaid search results. A search engine discovers and reads pages (crawling), then decides which pages to add to its index (indexing). When someone searches for “what is a server”, it picks and orders relevant results from that index.
How to try it In index.html, replace the content between <body> and </body> with this example. Save the file and reload it in the browser.
<article>
<h2>What Is a Server? | Web Development Guide</h2>
<p>A server responds to requests from browsers and other clients.</p>
</article>
What to expect This is a mock search result. The heading and short description help someone decide whether the page answers their question.
Answer the search and organize the page
Start with a direct answer to the visitor’s question. Use an h1 for the main heading and h2 elements for related sections. Put the main topic where it reads naturally. Add examples or details that help the visitor understand the answer.
How to try it In index.html, replace the content between <body> and </body> with this example. Save the file and reload it in the browser.
<main>
<h1>What Is a Server?</h1>
<p>A server is a computer or program that responds to requests from clients.</p>
<h2>How a Web Server Responds</h2>
<p>When you open a website, your browser requests a page.
The web server can respond with an HTML document.</p>
</main>
What to expect The first paragraph answers the question. The subheading then leads into a concrete example.
Page title <title>
The title names the entire HTML document and appears in the tab. Search engines can also consider it when generating the title link on a results page. Give each page a short distinct title and use a consistent visible heading so the topic is clear.
How to try it In index.html, place the code inside the existing <head>. Replace any existing tag for the same setting, then save and reload.
<title>What Is a Server? | Web Development Guide</title>
What to expect Reload and look at the browser tab. In the interactive preview, the title is printed in the preview pane. Google may use other text from the page to generate a title link.
Page summary with meta description
A meta description gives a short summary of what is available on the page. Google may use it to generate the snippet below a result’s title, or pick text from the page that better answers the search. Write descriptions that reflect the content of each page.
How to try it In index.html, place the code inside the existing <head>. Replace any existing tag for the same setting, then save and reload.
<meta name="description"
content="Learn what a server is and how it responds to a browser request.">
What to expect Inspect the head in DevTools to find the description. The interactive preview prints the tag so you can see its content.
Link to related pages with <a href>
Once a reader understands what a server is, offer a relevant next step. Use an anchor with an href that points to a real page. Search engines can follow these links to discover other pages. Clear link text tells readers and search engines what they will find there.
How to try it In index.html, replace the content between <body> and </body> with this example. Save the file and reload it in the browser.
<p>See also:
<a href="https://javascript-training.cloudninemm.com/docs/read/en/database/fundamentals/">
Learn about databases and database servers
</a>
</p>
What to expect The link text names the linked lesson. In the interactive preview, clicking the link shows its URL in the console.
Describe meaningful images with alt text
When an image explains part of the topic, use alt to describe the point the image makes in that context. It helps people who cannot see the image and helps search engines understand it. For a purely decorative image, use alt="".
How to try it In index.html, replace the content between <body> and </body> with this example. Save the file and reload it in the browser.
<img src="https://javascript-training.cloudninemm.com/docs/media/database/what-is-a-server.webp"
alt="Rows of server racks in a data center."
width="320"
height="180">
What to expect The photo shows server racks. Inspect the image element in DevTools to read its alt text.
Set the mobile viewport
The viewport is the area in which the browser displays the page. The device-width setting helps mobile browsers lay out this page at the actual device width. This metadata supports responsive design and applies when a visitor opens the page.
How to try it In index.html, place the code inside the existing <head>. Replace any existing tag for the same setting, then save and reload.
<meta name="viewport" content="width=device-width, initial-scale=1">
What to expect The tag is in head. On a phone or in the device toolbar, the layout can use the phone’s viewport width.
Preferred URL with rel="canonical"
If several URLs show equivalent content, a canonical link signals the preferred URL to a search engine. It can evaluate other signals too, such as internal links and a sitemap. Put the canonical link in head and use the preferred URL consistently in those other places.
How to try it In index.html, place the code inside the existing <head>. Replace any existing tag for the same setting, then save and reload.
<link rel="canonical" href="https://example.com/guides/what-is-a-server">
What to expect If /guides/what-is-a-server and /guides/what-is-a-server?ref=home show the same content, both can signal the URL without ?ref=home as preferred. The visitor’s address bar stays on the URL they opened.