Performance: SEO-friendly HTML
SEO-friendly HTML affects how quickly search engines can crawl and index your page, impacting your site's visibility and ranking.
<header><h1>Welcome to our site</h1></header>
<div><div><div>Welcome to our site</div></div></div>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Non-semantic <div> nesting | High (deep tree) | Multiple reflows | High paint cost | [X] Bad |
| Semantic tags with clear hierarchy | Low (shallow tree) | Single reflow | Low paint cost | [OK] Good |
| Empty alt attributes | N/A | N/A | N/A | [!] OK but poor SEO |
| Descriptive alt attributes | N/A | N/A | N/A | [OK] Good SEO |
| Inline styles and scripts | Moderate | Blocks rendering | Moderate paint | [X] Bad |
| External CSS and deferred scripts | Low | Non-blocking | Low paint | [OK] Good |
<h1> in SEO<h1> tag defines the main heading of the page content, which search engines use to understand the page topic.<title> tag sets the browser tab title but is not visible in the page body. <header> is a semantic container, and <div> is generic with no SEO meaning.name="description" and a content attribute with the description text.<meta name="description" content="This is my page"> matches the correct syntax. Options A, B, and D use incorrect attribute names or order.<section>
<h2>About Us</h2>
<article>
<h3>Our Mission</h3>
</article>
</section><h2> and <h3> tags create visible headings with different sizes and importance.<h2>About Us</h2> is the main heading in the section, and <h3>Our Mission</h3> is a subheading inside the article, so both show in order.<head> <title>My Site</title> <meta name="description" content="Welcome to my site"> <h1>Home Page</h1> </head>
<h1><h1> tag is for visible page content and must be inside the <body>, not <head>.<title> is correctly filled, and the meta description has content. Missing charset is not an error for SEO but recommended.<article> tag wraps the whole blog post. Inside it, <header> holds the title, <section> contains main content, and <footer> includes author and notes.<article><header><h1>Title</h1></header><section>Content</section><footer>Author and notes</footer></article> uses all correct semantic tags in proper order. <div><h1>Title</h1><div>Content</div><div>Author</div></div> uses generic <div> tags, which are less SEO-friendly. <section><h1>Title</h1><footer>Author</footer></section><article>Content</article> misplaces <article> outside main content. <header><h1>Title</h1></header><article>Content</article><footer>Author</footer> separates header and footer outside article, which is less clear.Pass the test and this pattern moves unknown