HTML (HyperText Markup Language) ek standard language hai webpages banane ke liye...
HTML (HyperText Markup Language) ek standard language hai webpages banane ke liye. Yeh tags ka istemal karke content ko structure yaane layout deti hai.
HTML Document ka Basic Structure
Ek HTML document ka basic structure kuch mahatvapurn tags par adhaar karta hai:
- <html>: HTML document ka root ya main tag hai. Saare elements iske andar aate hain.
- <head>: Metadata, stylesheet links, scripts aur document ka title rakhta hai.
- <title>: Yeh webpage ka title set karta hai jo browser tab par dikhta hai.
- <body>: Yeh webpage ka main content rakhta hai (text, images, links, etc.).
Text Format karne ke Tags
- <h1> to <h6>: Heading tags, jisme <h1> sabse badi aur <h6> sabse chhoti heading hai.
- <p>: Paragraph ke liye tag.
- <br>: Line break tag, nayi line add karne ke liye bina naya paragraph shuru kiye.
- <hr>: Horizontal line ya separator.
- <strong>: Bold text aur yeh semantically important text ko darshata hai.
- <em>: Italics mein emphasis ya stress dikhane ke liye.
- <mark>: Text ko highlight karta hai.
- <small>: Text ko chhoti font size mein dikhata hai.
- <del>: Strikethrough effect ke liye, deleted content dikhane mein madad karta hai.
- <ins>: Inserted text ke liye, often underlined.
- <blockquote>: Longer block quotes ke liye, generally indented.
- <code>: Inline code snippets dikhata hai.
- <pre>: Preformatted text jo spacing aur formatting ko preserve karta hai.
Links aur Images
- <a href="URL">: Hyperlinks banane ke liye anchor tag. Example: <a href="https://example.com">Link Text</a>.
- <img src="URL" alt="Description">: Image ko display karta hai. src image ka path aur alt image ka description batata hai.
Lists
- <ul>: Unordered list, jo bullet points ke roop mein dikhai deti hai.
- <ol>: Ordered list, jo numbers ke sath dikhai deti hai.
- <li>: List item, jo <ul> ya <ol> ke andar aata hai.
Tables
HTML tables data ko structured format mein dikhane ke liye istemal hoti hain.
- <table>: Main table container.
- <tr>: Ek row ya line banata hai.
- <td>: Table ka ek data cell.
- <th>: Table header cell, jo generally bold aur centered hota hai.
- <caption>: Table ka title ya description dikhata hai.
Example:
<table>
<tr>
<th>Name</th>
<th>Age</th>
</tr>
<tr>
<td>Alice</td>
<td>30</td>
</tr>
</table>
Form Elements
Forms user input lene ke liye hote hain.
- <form>: Main form container.
- <input>: Alag-alag types ke input fields, jaise text, password, submit, checkbox, etc. Example: <input type="text" name="username">
- <label>: Kisi form element ko label provide karta hai.
- <textarea>: Multi-line text input area ke liye.
- <button>: Button element jo click kiya ja sakta hai.
- <select> aur <option>: Drop-down list ke liye.
Semantic HTML Tags
Semantic tags webpage ke content ko logically aur meaningfully structure karte hain.
- <header>: Introductory content ya navigation links ke liye.
- <nav>: Navigation links ka section.
- <section>: Related content ko group karta hai.
- <article>: Self-contained content ke liye jo independently distribute kiya ja sakta hai.
- <aside>: Main content se related par alag content, jaise sidebar.
- <footer>: Footer information, jaise copyright aur contact info ke liye.
Multimedia Tags
- <audio>: Page mein audio content ko embed karta hai. Example: <audio controls><source src="audio.mp3" type="audio/mp3"></audio>
- <video>: Page mein video content embed karta hai playback controls ke sath. Example: <video width="320" height="240" controls><source src="video.mp4" type="video/mp4"></video>
Comments
Comments HTML mein display nahi hote, aur yeh code mein notes ya reminders ke liye use hote hain.
<!-- Yeh ek comment hai -->
Document Type Declaration
<!DOCTYPE html> declaration define karta hai ki document HTML5 mein likha gaya hai aur yeh kisi bhi HTML document mein pehli line par likha jata hai.