Professional Documents
Culture Documents
Input Tag:
- Input tag makes an input field where user can enter data.
- Input is a singular tag; it is not closed because the user is entering the
data not the coder. It does not have any content between it. That’s why
it is a singular tag.
Syntax: <input>
Label Tag:
- Label tag is used to tell what input name/label is?
- It is used specifically for input tag
- It is a paired tag, as there is needed text inside it.
- It works in the same way as <p> and <span>.
Syntax: <label>Name</label>
Attribute:
- Attribute is used to add extra properties/feature in a tag.
- Every tag has its own attribute but there is also some attribute which
can be used on every tag.
- Attributes are always specified in the start tag.
For Example, width, height, name, style are some attributes.
Types of INPUT in Input tag:
1. Button: The <input type="button"> defines a clickable button (mostly used
with a JavaScript to activate a script).
2. Checkbox: to make a checkbox as input
3. Color: to make a color chooser input
4. Date: to make a time chooser input
5. datetime-local: to make a date and time chooser input.
6. Email: to make an email field where user can input an email. It work
properly with backend
7. File: to input file from user.
8. Image: to define an image as submit button. The path to the image is
specified in the src attribute.
9. Month: to input month from user.
10. Number: to input number from user. It can be incremented or
decremented.
11. Password: to input password from user.
12. Radio: to make a radio button for selection from user. Example, in
choosing gender.
13. Range: defines a control for entering a number whose exact value
is not important (like a slider control).
14. Reset: defines a reset button which resets all form values to its
initial values.
15. Search: Define a search field
16. Submit: defines a submit button which submits all form values to
a form-handler
17. Tel: defines a field for entering a telephone number
18. Text: used to input text from user. Text is alphanumeric data.
19. Time: used to input time from user.
20. Week: to input week from user.
Image Tag:
- The <img> tag is used to embed/link an image in an HTML page.
- It is a single tag.
- The image tag has commonly two attributes:
src: Specifies the url/path to the image
alt: Specifies an alternate text for the image, if the image for some
reason cannot be displayed.
Example:
<ul>
<li>HTML</li>
<li>CSS</li>
</ul>
3. Descriptive List:
- A description list is a list of terms, with a description of each term.
- It has following tags:
1. <dl>: define the description list
2. <dt>: define the term (name) of list
3. <dd>: describe each term
For Example:
<dl>
<dt>Computer:</dt>
<dd>An electronic device</dd>
<dt>Mouse:</dt>
<dd>A pointing device </dd>
</dl>
Nested List:
- It means to add list inside list.
- You can add multiple list under list tags.
For Example:
In terms of Ordered List:
<ol>
<li>HTML
<ol>
<li>Hyper Text Markup Language</li>
<ol>
</li>
<li>CSS
<ol>
<li>Cascading Style Sheet</li>
<ol>
</li>
</ol>
<dl>
<dt>HTML</dt>
<dd> Hyper Text Markup Language
<dl>
<dd>It is a markup language </dd>
</dl>
</dd>
</dl>
Note:
1. You can also add ordered list in unordered or vice versa by using
method of nested list:
<ul>
<li>HTML</li>
<li>CSS
<ol>
<li>Cascading Style Sheet</li>
<li>It is used to style html elements</li>
</ol>
</li>
</ul>
2. You can also add ordered and unordered list under descriptive list.