Forum Moderators: open

Message Too Old, No Replies

Enclosing all text in <p> tags?

         

Mohamed_E

8:47 pm on Oct 9, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In another forum [webmasterworld.com] glyph asks:

Have inherited site (20 pages) with lots of blocks of kw containing text that are either only enclosed by table tags <td> or lie outside of other tags, e.g. p, table, h, etc.

Question: Is there any Google SERPS benefit to encapsulation in <p></p> tags? I.e. worth going through site to update everywhere? Larger question is, outside of h and a tags, does it matter much what tags general kw text is in?

His question deals with search engines, I would like to ask the more fundamental question: should all text be encapsulated in <p></p> (or other appropriate) tags?

Mea Culpa! I had been treating <p> as essentially a presentational element, and did not use it when I did not need it for that purpose. Going to HTML 4.01 Strict I discovered that the construct:

<blockquote>
Some text ...
</blockquote>

is not valid; blockquote requires as contents one or more block level elements.

For some reason

<h1>Some Header</h1>
Some text ...
<p>Some more text ...

is valid. Would it be "better" (in some sense) to add a <p> after each header? It does seem to make sense to say "This is a paragraph", rather than leave it at "This is a collection of words".

Am I beginning to understand what the standards mean about content versus presentation?

Rincewind

12:58 am on Oct 10, 2003 (gmt 0)

10+ Year Member



The paragraph tag <p> is not a presentation element. It is required as part of the grammar and punctuation of the content. It is no more part of presentation and layout than a period, comma, question mark or hyphen.

By default a paragraph tag is a block level element (takes a new line) and has padding above. However, you can change this in your css. Thus the paragraph tag <p> defines the structure and grammar of the content of the page while the css can defines the presentation for those <p> tags.

In some cases people do use <p> tags for presentation and layout, for example, this code should be avoided:

<p>Some text</p>
<p>&nbs;</p>
<p>&nbs;</p>
<p>&nbs;</p>
<p>Some more text after a gap.</p>

Instead, perhaps a pair of <div>s with padding would be more appropriate.

Also, if you don't think a <p> tag is suitable, consider using some other structural markup such as un-ordered lists <UL>.

g1smd

8:57 pm on Oct 16, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



A "real" document should consist of headings, paragraphs, lists, tables (of tabular data), and forms (along with images and links within). There are HTML tags for all of these things. No content should be left "floating".

Just like in a book, it has chapter headings, paragraphs of text, footnotes, lists, tables, etc, in a clearly laid out manner.