Should all text fit in paragraph tags?

If I have a small amount of text, I need to add it to the web page, should they always be in the <p> tags? Or is it normal to just have them in a div sometimes?

+8
html css
source share
2 answers

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

Using <p> tags in this case is semantically correct - similarly, semantically correct pages are usually ranked in search engines for various reasons (for example, how efficiently crawlers process your site, etc.).

+7
source share

It would be better to use the p tag to sort the text. You can put the p tag inside the div tag if you want to apply a specific style to the layout. If you want to keep your text you can use the "pre" tag.

0
source share

All Articles