Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should all text be placed in paragraphs tags?

Tags:

html

css

If I have small amounts of text I need to add to a webpage, should they always be in <p> tags? Or is it ok to just have them in a div occasionaly?

like image 636
Evanss Avatar asked Mar 27 '13 14:03

Evanss


People also ask

Does text need to be in a paragraph HTML?

Text can either be placed by itself or in paragraphs, but it's generally bad practice to place text by itself. Later on, when you get onto styling and CSS, you'll be able to change your text's colours, fonts, size, etc. If your text is in a p tag, you know that you can tell CSS to make your desired changes to 'p'.

Where do we place the paragraph tag?

The <p> tag defines a paragraph of text. It is a block-level element and always starts on a new line. Before and after each paragraph, browsers add margin automatically.

What is the correct tag for a paragraph?

The <p> tag defines a paragraph. Browsers automatically add a single blank line before and after each <p> element.


1 Answers

<div>'s should be used for layout and positioning purposes, not for storing text.

Using <p> tags is semantically correct in this case - similarly, semantically correct pages tend to be ranked higher in search engines for various reasons (such as how effectively crawlers parse your website etc.).

like image 81
dsgriffin Avatar answered Oct 03 '22 01:10

dsgriffin