HTML Beginner Notes GeeksforGeeks
HTML Beginner Notes GeeksforGeeks
1. <img> Tag
Definition: Embeds an image on the webpage. It's a self-closing tag (no </img> needed).
Key Attributes:
- alt – text description if the image doesn’t load (important for accessibility)
Example:
2. Table Tags
<table> – Defines the start of a table.
border – Adds a visible border (thickness in pixels). Note: deprecated in HTML5, replaced
by CSS.
Example:
<table border="1">
<tr>
<th rowspan="2">Category</th>
<th colspan="2">Details</th>
</tr>
<tr>
<th>Item</th><th>Price</th>
</tr>
<tr>
<td>Books</td><td colspan="2">Various items</td>
</tr>
</table>
3. Form Elements
<form> – Container for form controls (ignore action/method for now).
<input> – For single-line user input. Common types: text, email. Also supports placeholder,
name.
Example:
<form>
<label for="email">Email:</label><br>
<input type="email" name="useremail" placeholder="Enter your
email"><br><br>
<label for="message">Message:</label><br>
<textarea name="message" placeholder="Your message
here"></textarea><br><br>
<button>Submit</button>
</form>
Summary
- <img>: Use src, alt, width, height to embed and size images properly.
- Tables (<table>, <tr>, <th>, <td>): Organize data; use border, colspan, and rowspan for
layout structure.
- Forms: Build user input interfaces with input, label, textarea, and button. Use name and
placeholder for usability and future processing.