Notes - WEBDEV1
Notes - WEBDEV1
What is HTML?
Structure: HTML defines the layout and structure of a web page using
elements such as headings, paragraphs, links, images, and more.
1. <!DOCTYPE html>
3. <head>
4. <title>
5. <body>
<title>: Provides the page title, crucial for SEO and usability.
.html Extension
2. Paragraphs (<p>)
3. Anchors (<a>)
4. Images (<img>)
8. Divisions (<div>)
9. Spans (<span>)
Syntax:
Syntax:
Fallback: If an image fails to load, the alt text provides context to the
user.
<ol>
<li>First Step</li>
<li>Second Step</li>
</ol>
o Example:
<ul>
<li>Apple</li>
<li>Banana</li>
</ul>
The <table>, <tr>, <td>, and <th> Tags for Creating Tables
Tags:
Example:
<table>
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
<tr>
<td>Row 1, Cell 1</td>
<td>Row 1, Cell 2</td>
</tr>
</table>
1. <form>
o Attributes:
o Example:
o Attributes:
o Example:
3. <label>
o Example:
<label for="username">Username:</label>
<input type="text" id="username" name="username">
1. <textarea>
o Example:
<textarea name="comments" rows="4" cols="50">Enter
your comments here...</textarea>
2. <button>
o Creates a clickable button.
o Example:
<button type="submit">Submit</button>
Form Validation: Ensures that user input is complete and in the correct
format before submission.
Types of validation:
User Input Handling: Protects against malicious input (e.g., SQL injection,
XSS attacks) by sanitizing and validating data.
o Accessible at validator.w3.org.