HTML Tags
List Tag
List tag allow to create list in your web page. There are two type of list, we can create in our web page.
1. Ordered List
An ordered list starts with the <ol> tag. For each list item <li> tag is used.
The list items will be marked with numbers by default.
Example:
<ol> <li>Coffee</li> <li>Tea</li> </ol>
2. Unordered List
An unordered list starts with the <ul> tag. For each list item <li> tag is used.
The list items will be marked with bullets (small black circles) by default.
Example:
<ul> <li>Coffee</li> <li>Tea</li> </ul>
Table Tag
<table> tag in HTML is used to show data in column and row format in web browser. A table contains rows and columns.
Tags used to form a table:
<tr>: tr stands for table row. Each table row starts with a <tr> and ends with a </tr> tag.
<td>: td stands for table data. Everything between <td> and </td> are the content of the table cell.
<th>: th stands for table header. For defining a table header we can use the <th> tag instead of the <td> tag.
Example:
Form Tag
<form> tag: HTML <form> tag is used to create a HTML form for user input.
The <form> tag is a container for different types of input tags.
<form>tag attribute: action is the <form> tag attribute used to define the URL. This URL is call when we submit our form.
Example:
<input> tag: This is a self closing tag used to create a single line input field for capture the user input. <input> tag have many attributes, like type, name, id.
Note: type attribute is used to define the type of the input field. like text, email, number, radio, date, submit etc.
Example:
<label> tag: To define the label for different <form> tags. We can use <label> tag. The for attribute of the <label> tag should be equal to the id attribute of the <input> tag to bind them together.
Example: <label for="name">Name</label>
<select> and <option> tags: The <select> and <option> tags are used together to create a select dropdown for user input.
Example:
Radio Input field: <input> tag is used to create a radio input field. Only one radio button in a group can be selected at the same time. Radio buttons are normally presented in radio groups .
Note: The radio group must share the same name (the value of the name attribute) to be treated as a group.
Example:
<textarea> tag: This tag is used to create a multi-line input field. Attribute of the <textarea> tag are:
rows: The rows attribute specifies the visible number of lines in a text area.
cols: The cols attribute specifies the visible width or number of column in text area.
Example: