HTML Page Title
The
Setting a great page title
EXAMPLE
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='UTF-8' />
<!--
Best practice:
- Most important keywords first
- Brand at the end, separated by | or -
- Under ~60 characters so search engines do not truncate
- Unique per page
-->
<title>Hello World in HTML | MySite</title>
<meta name='description' content='A 2-minute walkthrough of the simplest HTML5 document.' />
<!-- Open Graph + Twitter for shares -->
<meta property='og:title' content='Hello World in HTML' />
<meta property='og:description' content='A 2-minute walkthrough of the simplest HTML5 document.' />
<meta property='og:image' content='https://example.com/og/hello-world.png' />
<meta name='twitter:card' content='summary_large_image' />
</head>
<body>
<h1>Hello World in HTML</h1>
<p>The h1 should match the title's intent so users land on the page they expected.</p>
</body>
</html>
Why it matters
A bad title hurts traffic, bookmarks, and trust. Keep it specific (what is on this page?), front-load the topic, and add the brand at the end. Pair it with a meta description and Open Graph tags so links shared anywhere render nicely.
Tip: Tweak the snippet with Try it Yourself », then sit the quiz at the bottom of the page.
Example
Example
<!DOCTYPE html>
<html>
<head>
<title>HTML Page Title</title>
</head>
<body>
<h1>HTML Page Title</h1>
<p>This is a demo page for the "HTML Page Title" lesson.</p>
</body>
</html>
Try it Yourself »
Exercise
Set the text shown on the browser tab.
<head><
>My Shop</
></head>
Goes inside <head>.
Discussion
Loading…