HTML Sample Code
Text Formatting Tags
<b>: Bolds the text enclosed within the tag. Example: <b>This text will appear bold.</b>
<i>: Italicizes the text enclosed within the tag. Example: <i>This text will appear italic.</i>
<u>: Underlines the text enclosed within the tag. Example: <u>This text will appear underlined.</u>
<strike>: Strikes through the text enclosed within the tag. Example: <strike>This text will appear
strikethrough.</strike>
<strong>: Represents strong importance, usually displayed Example: <strong>This text is very important.</strong>
in bold.
<del>: Renders the text enclosed within the tag with a Example: <del>This text will appear with a
strikethrough effect. strikethrough.</del>
<em>: Indicates emphasis, usually displayed in italics. Example: <em>This text is emphasized.</em>
<mark>: Highlights the text enclosed within the tag. Example: <mark>This text will be highlighted.</mark>
<small>: Reduces the font size of the text enclosed within Example: <small>This text will appear smaller.</small>
the tag.
<big>: Increases the font size of the text enclosed within Example: <big>This text will appear bigger than
the tag. normal.</big>
<sub>: Subscripts the text enclosed within the tag. Example: H<sub>2</sub>O will appear as H₂O.
<sup>: Superscripts the text enclosed within the tag. Example: 10<sup>2</sup> will appear as 10².
<abbr>: Represents an abbreviation or acronym with a Example: <abbr title="HyperText Markup
title attribute for expansion. Language">HTML</abbr>
Image and Hyperlink
<img>: Embeds an image into the webpage. Example: <img src="image.jpg" alt="Description of the
image">
<img> tag is used to insert images into web pages. It requires the src attribute, which specifies the URL of the image
file to be displayed. Additionally, the alt attribute is essential and provides alternative text that appears if the image
cannot be loaded or for accessibility purposes.
<a>: Represents a hyperlink to another webpage or Example: <a href="https://www.example.com">Click
resource. here to visit Example Website</a>
<a> tag, commonly known as the anchor tag, is used to create hyperlinks on web pages. It enables users to click on
the link and navigate to the destination specified in the href attribute. The href attribute contains the URL of the
linked page or resource.
HTML Table
<table>: Creates a table for organizing and displaying data Example:
in rows and columns. <table>
<caption>: Defines a caption or title for a <table> element. <caption>Table Title</caption>
<tr>: Defines a table row within a <table> element. <tr>
<td>: Represents a table data cell within a <tr> element. <th>Header 1</th>
<th>: Represents a table header cell within a <tr> element, <th>Header 2</th>
typically found in the header row of a table. <th>Header 3</th>
</tr>
<tr>
<td>Data 1</td>
<td>Data 2</td>
<td>Data 3</td>
</tr>
</table>
Exercise
HTML List
Image and Hyperlinks
HTML Table
Necessary Tags Necessary Attributes
<table></table> border=””
<caption></caption> cellspacing=””
<tr></tr> cellpadding=””
<td></td> width=”” height=””
<th></th> rowspan=””
colspan=””
align=”left/center/right”
valign=”top/middle/bottom”
Exercise