HTML tags with examples.
Hello Friends, In this blog post(HTML tags for example), I am going to let you know about the HTML Paragraph tag.
Within this blog(HTML tags for example), we are going to through What are the two types of HTML tags? What’s the most wrongly used tag in HTML? Is there a necessity to use HTML tags? What is the use of <br> tag and strike tag in HTML, What is paragraph tag in HTML? How do you use paragraph tags in HTML? What does P </ p mean in HTML? What is the P tag explained with an example? It is denoted by HTML element <p >,
See the below example for the same.
[code]
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
[/code]
When you see the HTML paragraph in the output window or browser then you will see the browser itself leaves a space or margin before and after the Paragraph|HTML tags with example|
HTML Display:
You can not predict the exact HTML output over the browser.
It will also depend on your screen size whether it is larger or smaller. So window screen size definitely affects the HTML output.
you can not manipulate output by adding extra spaces or lines to your HTML code as a browser will remove the line and extra space when a page will load.
See the example below for the same.
[code]
<p>
In this paragraph
lots of lines in the
source code will before
ignored by the browser.
</p>
<p>
In this paragraph
lots of spaces in the
source code will be
ignored by the browser.
</p>
[/code]
Never forget the END tag:
A browser would display the output correctly even if you missed writing the END tag.
See the example below for the same.
[code]
<p>This is a paragraph.
<p>This is another paragraph.
[/code]
The example explained above can work on most browsers but we should not be dependent as it is not sure to work always and can produce an unexpected result at any point in time.
HTML Line Break:
If you want to break a line without starting a paragraph then you should use the <br> HTML tag.
This is an empty tag and thus doesn’t have an END tag. See the below example for the same.
[code]
<p>This is<br>a paragraph<br>with line breaks.</p>
[/code]
What is the HTML paragraph Poem problem?
As per this problem if you write a poem inside a paragraph tag with a proper line break and spaces but it will always display in one single line. See the below example for the same.
[code]
<p>
The moon is shining o’er the field.
A little breeze is blowing.
The radish leaves are crisp and green.
The lettuces are growing.
</p>
[/code]
So what is the solution to such a problem?
HTML <pre> tag is the solution for this problem. This tag is used for preformatted text.
The text inside this <pre> tag is displayed as you write with the fixed width and font size.
It also maintains all line breaks and spaces that you have given while writing. See the below example for the same.
[code]
<pre>
The moon is shining o’er the field.
A little breeze is blowing.
The radish leaves are crisp and green.
The lettuces are growing.
</pre>
[/code]
Now go through some random questions related to HTML tags below:
What are the two types of HTML tags?
Mainly there are two types of HTML tags, one is a single tag and another is a paired tag. They are also known as open tags and closed tags.
<br> tag is an example of a single tag or singular tag.
<p>….</p> tag is an example of paired tag.
What’s the most wrongly used tag in HTML?
There are many tags in HTML that can be used wrongly by programmers or users. For example <meta>, <br>, <small>, <table>, and etc.
What is the use of <br> tag and <strike> tag in HTML?
<br> tag is used to leave a single line and keep the cursor one line down. And strike tag is used to draw a horizontal line over the text which is written between the strike tag.
Conclusion:
Using this blog post(HTML tags for example) we have learned HTML paragraph tags along with some other HTML tags. We have also gone through What are the two types of HTML tags? What’s the most wrongly used tag in HTML? Is there a necessity to use HTML tags? What is the use of <br> tag and strike tag in HTML, What is paragraph tag in HTML? How do you use paragraph tags in HTML? What does P </ p mean in HTML? What is the P tag explained with an example?
In case of any queries, you can write to us at a5theorys@gmail.com we will get back to you ASAP.
Hope! you would have enjoyed this post about HTML tags for example.
Please feel free to give your important feedback in the comment section below|HTML tags with example|
Have a great time! Sayonara!