Following are some basic html tags that can be used to learn html effectively. Please practice these in any editor or IDE as learnt in our previous post.
We can add elements inside the body tag to define the page layout.
HTML Element
Everything from starting to the ending tag.
<body> Opening tag
→Content←
</body> Closing tag
HTML Attributes
Used to add more information corresponding to an HTML tag.
Example: <a href=”https:// itfreesource.com/”> Click here to visit IT Free Source</a>
<a –> anchor tag
href–> href attribute
We can either use Single or double quote in attributes.
The Heading Tag
Heading tag is used to mark headings in HTML. from h1 to h6, we have tags for the most important to the least important heading.
<h1> Most Important heading </h1>
<h2> Another heading H2 </h2>
<h3> Another heading H3 </h3>
<h4> Another heading Hy </h4>
<h5> Another heading H5 </h5>
<h6> Another heading H6 </h6>
Note: We should not use HTML headings to make text thick or bold.
The Paragraph Tag
Paragraph tags are used to add paragraphs to an HTML page.
<P> This is a paragraph </p>
The Anchor Tag
The Anchor lag is used to add links to an existing Content inside an HTML page.
<a href=”https:// google.com”> click me </a>
The Image Tag
Image g tag is used to add images in an HTML page
<img src=”image.jpg” >
Image.jpg–> relative url of an image
Bold, Italic and Underline Tags
We can use bold, italic and underline tags to highlight the text as follows:
<b> This is bold </b>
<i> This is italic </i>
<u> This is underline </u>
br Tag
The br tag is used to create line breaks in an HTML document.
big and small Tags
We can make the text a bit larger and a bit smaller using big and small tags respectively.
hr Tag
<hr> tag in HTML is used to create a horizontal ruler often used to separate the content.
Subscript & superscript
We can add subscript and superscripts in HTML as follows:
<sub> this </sub> is subscript
<sup> this </sup> is superscript
Pre Tag
HTML always ignores extra spaces and newlines. In order to display a piece of text as is, we use pre tag
<pre>
This is written
→ Rendered as-is.
using pre
tag
</pre>
📢 Join Our Telegram Channel
💼 Get Daily IT Job Updates, Interview Tips & Exclusive Alerts directly on Telegram!
👉 Join Telegram