An Interesting Knowledge About Tags In HTML

Tags in HTML

Tags in HTML are like labels that tell the how to display content. There are varieties of tags in HTML, we have the open and close tags and the self closing tags.

Types of tags in HTML

Self closing tags: they close themselves eg image and breakline

Open and close tags: open at firstvand close at the end.

Tables

They’re used for displaying data in rows and columns

Table tags

<table> – this is the table itself

<tr> – Table row

<td> – Table data

<th> – Table head

Code example

Code output

Form

Form is one of the very important tags used for inputting and organizing data.

Examples of Form tags

<form> – this is the tag itself

<input>

<fieldset>

<select>

<label>

<textarea>

<button>

Form has the attributes “Type and Placeholder

Code Example

Code Output

Comments in HTML

Comments is a line of code that can not be executed.

ID and Class Tags In HTML

They are used for targeting a specific data or content in the html document.

Image Tag in HTML

<img> – Its used for displaying images

Attributes of images

<src> – Its used for uploading images with URL

<alt> –  Alternative (Its used to show if image fails to load)

Code Example

Link in HTML

<link> – this is the tag itself

<a> – this is another tag for link

Link attributes are Rel and Href

Rel (Relationship)- It specify the relationship between the current document and the linked one which is Stylesheet.

Href (Hypertext References)- It is an attribute in the tag that specifies the URL of the linked document.

Leave a Comment

Your email address will not be published. Required fields are marked *