Headings are used to define titles and subtitles on a web page. There are six levels of headings, from <h1>
to <h6>
, with <h1>
being the most important and <h6>
the least.
<h2>This is a Heading 2</h2>
<h3>This is a Heading 3</h3>
The <p>
tag is used to define a paragraph of text.
The <a>
tag is used to create hyperlinks. It can link to another webpage, email address, or any other URL.
The <img>
tag is used to embed images in a webpage. It requires the src
attribute to specify the image source and the alt
attribute for alternative text.
HTML supports ordered and unordered lists. Use <ul>
for unordered lists and <ol>
for ordered lists. List items are defined with the <li>
tag.
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul> <!-- Ordered List -->
<ol>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
</ol>
Use <b>
for bold text and <i>
for italic text. For semantic HTML, consider using <strong>
and <em>
instead.
<p><i>This text is italic.</i></p>
<p><strong>This text is strongly emphasized.</strong></p>
<p><em>This text is emphasized.</em></p>
The <br>
tag is used to insert a line break within text, and <hr>
is used to create a horizontal rule.
<hr>
<p>This is text separated by a horizontal line.</p>
HTML tables are created using the <table>
tag, with <tr>
for rows, <th>
for headers, and <td>
for data cells.
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
<tr>
<td>Data 1</td>
<td>Data 2</td>
</tr>
<tr>
<td>Data 3</td>
<td>Data 4</td>
</tr>
</table>
Forms are used to collect user input. The <form>
tag encloses form elements like <input>
, <textarea>
, and <button>
.
<label for="name">Name:</label>
<input type="text" id="name" name="name">
<br>
<label for="email">Email:</label>
<input type="email" id="email" name="email">
<br>
<input type="submit" value="Submit">
</form>
2 Comments
Excellent
ReplyDeletethank you for this blog
ReplyDelete