Text inside <div> tags - semantically correct or not?
Most of us saw something like this:
<div class="rights">All rights reserved!</div> I just wanted to know if this is the right job? or althogh, which will be displayed in the browser, is it better to use the <p> for example?
I ask you to know about this if it has any Google (SEO), page load time, compatibility, HTML validity, ... problems / disadvantages.
First of all, most browsers will automatically add space (margin) around the <p> .
There is no real performance issue if you use or not use the <p> . In addition, html will not be invalid.
The main reason for using this tag is to tell the browser that you define the block element.
This will not be affected by search engine optimization.
Change In your example, you'd better use the <p> , since the <div> also a block element and has nothing else but the text in it, so it will be more specific.
It’s safer to use <p> .Crawlers even prioritize large texts such as the <h1> and <h2> tags.
I heard that scanners also check CSS formatting (in case you want to trick hidden texts with keywords), so this is also a factor.
As for reality and performance, it does not matter.
From W3.org Div Element
The authors strongly recommend considering the div element as the last resort element, since no other element is suitable. The use of more appropriate elements instead of the div element increases accessibility for readers and simplifies maintenance for authors.
Regarding reality, etc., see panther answer
It should be a paragraph, but it is a line that you do not need semantically at all (people will not look for this information to find out your site).
ads. page load time - no, it doesn’t matter if you use or
announcement. compatibility - a paragraph has a margin, for example. when you turned off the styles. Nothing more.
ads. Validity - Both are valid HTML, but validity does not affect SEO. Irrelevant.