What is Paragraph in HTML | HTML Paragraph.

0
290
paragraph in html

Table of Contents

HTML Paragraphs.

HTML paragraph or HTML p tag is used to define a html paragraph in a webpage. Let’s take a simple example to see how it work. It is a notable point that a browser itself add an empty line before and after a paragraph. An HTML <p> tag indicates starting of new paragraph.

HTML paragraph or HTML p tag is used to define a paragraph in a webpage. Let’s take a simple example to see how it work. It is a notable point that a browser itself add an empty line before and after a html paragraph. An HTML <p> tag indicates starting of new paragraph. If you put a lot of spaces inside the HTML p tag, browser removes extra spaces and extra line while displaying the page. The browser counts number of spaces and lines as a single one. An HTML <br> tag is used for line break and it can be used with paragraph elements. Following is the example to show how to use <br> with <p> element. The <p> HTML element represents a html paragraph. Paragraphs are usually represented in visual media as blocks of text separated from adjacent blocks by blank lines and/or first-line indentation, but HTML paragraphs can be any structural grouping of related content, such as images or form fields.

Paragraphs are block-level elements, and notably will automatically close if another block-level element is parsed before the closing </p> tag. See “Tag omission” below. By default, browsers separate paragraphs with a single blank line. Alternate separation methods, such as first-line indentation, can be achieved with CSS:

Paragraph in html

Now open your vs code editor and go to the right top section and click on file and select new file then save filename.html after this press ctrl+1 then html syntax generate automatically on your editor. This feature inbuild only visual code editor so i suggested you download this editor and make projects easily because it is a best code editor software. And this design for stand fan project make a fast with visual studio code editor.

First of all go to the code editor and then select new file. After this save this file with .html and open this file in your code editor. After that press the ctrl+1 and enter then you can get the html syntax easly. Now go to the body tag and give the p tag in this tag create some dummy text like this lorem for make demo.

Paragraph Design

Now we will design the pragraph design using css. So let’s design, first of all you have to know how we write css. We write css in 3 ways first we can write inline and second we can write it internal and third we can write it external so that we have to create new css file but in this article we have used internal css so that We will not have to create css file separately and we can work inside the same file.

First of all we have to go inside the head section and going inside we have to take style tag then we will take * tag and by applying curly braces open and close in it we will keep margin as 0 and padding as 0. And will keep its box sizing border box. Then we will take the body tag and flex the display in it, then we will center the justify content, after that we will center the align items and also make the background color rgb.

*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
body{
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: rgb(22, 22, 22);
}

Now we are give the p tag for designing and in this tag we create some properties like font size and paragraph background. After this give the font family poppins. And give the font color xyz. Give the some more propertis like margin and padding and text align center or justify.

Most Popular Articles

How to create porfolio header with dark mode enable and disable using html, css and javascript?

How to make user profile like a instagram using html, css?

How to create glass card employees list using css?

See this example:

  1. <p>This is first paragraph.</p>  
  2. <p>This is second paragraph.</p>  
  3. <p>This is third paragraph.</p>

Space inside HTML Paragraphs

If you put a lot of spaces inside the HTML p tag, browser removes extra spaces and extra line while displaying the page. The browser counts number of spaces and lines as a single one.

  1. <p>  
  2. I am  
  3. going to provide  
  4. you a tutorial on HTML  
  5. and hope that it will  
  6. be very beneficial for you.  
  7. </p>  
  8. <p>  
  9. Look, I put here a lot  
  10. of spaces                    but            I know, Browser will ignore it.  
  11. </p>  
  12. <p>  
  13. You cannot determine the display of HTML</p>  
  14. <p>because resized windows may create different result.  
  15. </p>  

Output:

I am going to provide you a tutorial on HTML and hope that it will be very beneficial for you.

Look, I put here a lot of spaces but I know, Browser will ignore it.

You cannot determine the display of HTML

because resized windows may create different result.

Accessibility concerns

Breaking up content into paragraphs helps make a page more accessible. Screen-readers and other assistive technology provide shortcuts to let their users skip to the next or previous paragraph, letting them skim content like how white space lets visual users skip around.

Using empty <p> elements to add space between paragraphs is problematic for people who navigate with screen-reading technology. Screen readers may announce the paragraph’s presence, but not any content contained within it — because there is none. This can confuse and frustrate the person using the screen reader.

<p>Separating paragraphs with blank lines is easiest
for readers to scan, but they can also be separated
by indenting their first lines. This is often used
to take up less space, such as to save paper in print.</p>

<p>Writing that is intended to be edited, such as school
papers and rough drafts, uses both blank lines and
indentation for separation. In finished works, combining
both is considered redundant and amateurish.</p>

<p>In very old writing, paragraphs were separated with a
special character: ¶, the <i>pilcrow</i>. Nowadays, this
is considered claustrophobic and hard to read.</p>

<p>How hard to read? See for yourself:
  <button data-toggle-text="Oh no! Switch back!">Use pilcrow for paragraphs</button>
</p>

LEAVE A REPLY

Please enter your comment!
Please enter your name here