HTML Block and Inline Tags
Block Tags
HTML has two types of block level and inline tags. Whenever block level tags are shown on the webpage, a line of space is created before and after that automatically. Some common block level tags are div, p and h1 etc.
Inline Tags
The second types of tags are inline tags. When these tags are used, on the webpage these show up in the line of their previously used tags. If you do not use the <br/> tag then there is no space before and after it. Some inline tags are a span, anchor and img etc.
HTML <Div> Tag
The <div> tag is used to divide the page. This is also called a division tag. You can use other HTML tags in this tag. <div> is a block level tag. You can design your web page using this tag with CSS. This page divides the entire page into the section.
These sections can hide and show when you need it. By doing this, the information will be shown to the visitor, when he wants to see it. The CSS applies to all the tags inside of <div>.
The <div> tag can be used to separate different types of information from a webpage. An example of this is being given below.
The above script generates the given web page.
Some other block-level tags
<form>
<form> tag is a block level tag. With this tag, you can define the beginning and end of the form on a webpage. Other related tags from other HTML forms come within this tag.
<h1> ..... </ h6>
All heading tags are block level tags. Every heading defines a block of itself where it has an automatic line break before and after.
<p>
As you know paragraph is defined by <p> tag. This tag creates a break line before and after every paragraph. Therefore <p> tag is also known as block level tag.
<ol>, <ul>
Both list tags <ol> and <ul> are block- level tags because every list defines a section for itself.
<table>
The <table> tag is also considered a block level tag because it creates a separate section which is separate from the entire content of the page and includes line breaks before and after it.
<pre>
This is a block level tag. All other tags can be used in this tag and by using it, as you configure tags in the text editor, it will show up the same on the webpage.
HTML <span> Tag
<span> is an inline tag. It is used to format the text. Whenever you use this tag, your text remains in the same line instead of going to the second line.
Formatting applies only to the text that is between this tag. <span> tag does not have any attributes of itself, but you can use style and class attributes with this tag. You can also use this tag in the headings.
An example of this is being given below.
The above script generates the given web page.
Some Other Inline Tags
<a>
<a> tag is considered inline tag. You can link any text while using it. Doing so, it shows on that webpage in the same line.
<a>
<a> tag is considered inline tag. You can link any text while using it. Doing so, it shows on that webpage in the same line.
<b>
<b> tag bold the text without any line break. So this is also an inline tag.
<i>
<i> tag makes text italic and this is also an inline tag.
<u>
From the <u> tag, you underline the text. It is also considered inline tag.
<img>
From the <img> tag, you can insert the image between the texts. Doing so, it does not break any line in the text. Therefore <img> tag also has an inline tag.
<input>
With the <input> tag you can create other elements inside the form such as textbox and button etc. But if you do not use <br/> tag then there is no line break between these elements.
Hopefully, this "How to use Block and Inline Tags in HTML?” would be helpful for you. If it's so please help your friends and other bloggers to share this post on social media. If you have any question related to the post, please comment on the comment box and also follow this website for more information about the blogging and SEO tips.
Previous:- How to use List in HTML? Next:- How to use Form Tag in HTML?
You made some decent points there. I looked on the internet for more info about the issue and found most individuals
ReplyDeletewill go along with your views on this web site.
By the way, I heard about this awsome affiliate program for Instagram influencers.
Better apply soon before all the spots are filled up.
Here is the link: http://gul.ly/vhv8c