HTML5 Semantic Elements: ఉదాహరణలతో సంపూర్ణ గైడ్
Semantic HTML accessibility, SEO, మరియు code readability ని మెరుగుపరుస్తుంది. header, nav, main, article, section, aside, మరియు footer ను సరిగ్గా ఉపయోగించడం నేర్చుకోండి.
HTML5 Semantic Elements: సంపూర్ణ గైడ్
HTML5 కి ముందు, web pages అన్ని చోట్లలో generic <div> మరియు <span> tags తో నిర్మించబడేవి. అవి పని చేసినప్పటికీ, content యొక్క అర్థాన్ని గురించి ఏమీ చెప్పవు. Semantic HTML దానిని మారుస్తుంది.
Semantic HTML ఎందుకు ముఖ్యం
- Accessibility: Screen readers semantic landmarks ను సులభంగా navigate చేస్తాయి
- SEO: Search engines మీ page structure ను మెరుగ్గా అర్థం చేసుకుంటాయి
- Maintainability: ఇతర developers మీ code ను వేగంగా చదవగలరు
- Default styling: Browsers బుద్ధిమంతమైన defaults ను apply చేస్తాయి
ప్రధాన Semantic Elements
<header> — Introductory content
page లేదా article యొక్క పైభాగం కోసం ఉపయోగించబడుతుంది. logo, navigation, title, search కలిగి ఉండవచ్చు.
<header>
<h1>My Blog</h1>
<nav>...</nav>
</header><nav> — Navigation links
ప్రధాన navigation blocks కోసం కేటాయించబడింది. ప్రతి links list ను <nav> లో చుట్టవద్దు.
<nav aria-label="Main navigation">
<ul>
<li><a href="/">Home</a></li>
<li><a href="/blog">Blog</a></li>
</ul>
</nav><main> — ప్రధాన content
page యొక్క అత్యంత ముఖ్యమైన content. ప్రతి page కి ఒక్కటే <main> ఉండాలి.
<main>
<h1>w3primecode కి స్వాగతం</h1>
<p>మీ భాషలో కోడింగ్ నేర్చుకోండి.</p>
</main><article> — Self-contained content
ఒక blog post, news article, forum post, లేదా product card. స్వయంగా అర్థం అయ్యేలా ఉండాలి.
<article>
<h2>10 ఆధునిక CSS టెక్నిక్లు</h2>
<p>CSS గణనీయంగా ఎదిగింది...</p>
</article><section> — Themed grouping
content యొక్క thematic grouping, సాధారణంగా ఒక heading తో. <article> కంటే తక్కువ standalone.
<section>
<h2>Features</h2>
<p>మా product లో ఉంది...</p>
</section><aside> — Side content
ప్రధాన content తో tangentially related content — sidebars, pull quotes, ads.
<aside>
<h3>Related Posts</h3>
<ul>...</ul>
</aside><footer> — Footer content
Copyright, contact info, related links. page level లేదా <article> లోపల ఉపయోగించవచ్చు.
<footer>
<p>© 2026 w3primecode. అన్ని హక్కులు ప్రత్యేకించబడ్డాయి.</p>
</footer>ఒక సంపూర్ణ Page Structure
<body>
<header>
<nav aria-label="Main">...</nav>
</header>
<main>
<article>
<h1>Blog Post Title</h1>
<section>
<h2>పరిచయం</h2>
<p>...</p>
</section>
<section>
<h2>ప్రధాన Content</h2>
<p>...</p>
</section>
</article>
<aside>
<h2>Related</h2>
...
</aside>
</main>
<footer>...</footer>
</body>సాధారణ పొరపాట్లు
- **
<section>కు బదులుగా<div>ఉపయోగించడం** — heading ఉంటే,<section>ఉపయోగించండి - **ప్రతి
<ul>ను<nav>లో చుట్టడం** — ప్రధాన navigation blocks మాత్రమే - **బహుళ
<main>elements** — ప్రతి page కి ఒక్కటే - **Non-intro content కోసం
<header>ఉపయోగించడం** — ఇది కేవలం styled div కాదు
Accessibility Tips
- బహుళ navs ఉంటే
<nav>లోaria-labelఉపయోగించండి:<nav aria-label="Footer"> - captions ఉన్న images కోసం
<figure>మరియు<figcaption>ఉపయోగించండి - dates కోసం
<time datetime="2026-01-15">జనవరి 15, 2026</time>ఉపయోగించండి
ముగింపు
Semantic HTML accessible, SEO-friendly web pages యొక్క పునాది. ఈరోజే ఈ elements ను ఉపయోగించడం ప్రారంభించండి — మీ users (మరియు search engines) ధన్యవాదాలు చెబుతారు.