Chapter 8HTML Tutorial~1 min read
HTML Links — Anchor Tag
<a> Tag — Hyperlinks मराठीत
Links हे web चा fundamental भाग आहेत. HTML मध्ये links <a> tag ने बनतात — याला Anchor tag म्हणतात. Links मुळे एका document वरून दुसऱ्यावर navigate करता येते.
Anchor Tag Syntax
<a> Tag चा Basic Syntax
html
<a href="URL येथे टाका">
इथे text किंवा image येतो
</a>Anchor Tag चे Main Attributes
- ▸href — "hypertext reference" — link कुठे जाईल ते URL. हे सगळ्यात important attribute.
- ▸target — linked document कुठे उघडेल ते. _blank = नवीन tab, _self = same tab (default).
Links चे विविध प्रकार
html
<!-- External link — दुसऱ्या website वर -->
<a href="https://www.google.com">Google वर जा</a>
<!-- नवीन tab मध्ये उघडणे -->
<a href="https://www.youtube.com" target="_blank">YouTube</a>
<!-- Same page च्या specific section वर जाणे -->
<a href="#contact-section">Contact Section वर जा</a>
<!-- Email link -->
<a href="mailto:tatya@marathitech.com">Email करा</a>
<!-- Phone link — mobile साठी -->
<a href="tel:+919876543210">Call करा</a>Same Page च्या Section वर Jump करणे
Page Section Jump — उदाहरण
html
<!-- Page च्या वर link -->
<a href="#gardening-tips">Gardening Tips Section वर जा</a>
<p>इथे बराच content आहे...</p>
<p>आणखी content...</p>
<!-- Target section — id असणे important -->
<h2 id="gardening-tips">Gardening Tips</h2>
<p>इथे gardening tips आहेत...</p>Link Colors
- ▸Unvisited link: Blue + underlined (आधी कधी visit नाही केले)
- ▸Visited link: Purple + underlined (आधी visit केले आहे)
- ▸Active link: Red + underlined (click करत असताना)
📌
target="_blank" वापरताना security साठी rel="noopener noreferrer" नेहमी जोडा: <a href="..." target="_blank" rel="noopener noreferrer">
✅ Key Points — लक्षात ठेवा
- ▸<a href="URL">text</a> — clickable link बनवतो
- ▸href = link चे destination URL (required)
- ▸target="_blank" = नवीन tab मध्ये | target="_self" = same tab (default)
- ▸href="#section-id" = same page च्या section वर jump
- ▸target="_blank" सोबत rel="noopener noreferrer" जोडा
0/13 chapters पूर्ण