Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   When to use the p tag in html (http://www.velocityreviews.com/forums/t751574-when-to-use-the-p-tag-in-html.html)

Tony Johansson 07-16-2011 09:42 AM

When to use the p tag in html
 
Hello!

Can somebody give a good example when to use the p tag.
I know it's a paragraph

//Tony



Arne Vajh°j 07-16-2011 10:50 PM

Re: When to use the p tag in html
 
On 7/16/2011 5:42 AM, Tony Johansson wrote:
> Can somebody give a good example when to use the p tag.
> I know it's a paragraph


If you are sufficient XML oriented then you should have <p></p> around
all your text blocks.

Arne




Tony Johansson 07-16-2011 11:54 PM

Re: When to use the p tag in html
 

"Arne Vajh°j" <arne@vajhoej.dk> skrev i meddelandet
news:4e2215ae$0$314$14726298@news.sunsite.dk...
> On 7/16/2011 5:42 AM, Tony Johansson wrote:
>> Can somebody give a good example when to use the p tag.
>> I know it's a paragraph

>
> If you are sufficient XML oriented then you should have <p></p> around
> all your text blocks.
>
> Arne
>
>
>


I mean if it's only static text I don't need any p tag

//Tony



Arne Vajh°j 07-17-2011 02:02 AM

Re: When to use the p tag in html
 
On 7/16/2011 7:54 PM, Tony Johansson wrote:
> "Arne Vajh°j"<arne@vajhoej.dk> skrev i meddelandet
> news:4e2215ae$0$314$14726298@news.sunsite.dk...
>> On 7/16/2011 5:42 AM, Tony Johansson wrote:
>>> Can somebody give a good example when to use the p tag.
>>> I know it's a paragraph

>>
>> If you are sufficient XML oriented then you should have<p></p> around
>> all your text blocks.

>
> I mean if it's only static text I don't need any p tag


You really should use it all the time.

Not the 1995 style:

This is paragraph 1.
<p>
This is paragraph 2.

but XML style:

<p>This is paragraph 1.</p>
<p>This is paragraph 2.</p>

Arne

Brian Cryer 07-18-2011 10:37 AM

Re: When to use the p tag in html
 
"Tony Johansson" <johansson.andersson@telia.com> wrote in message
news:ivt8c7$t8n$1@dont-email.me...
>
> "Arne Vajh°j" <arne@vajhoej.dk> skrev i meddelandet
> news:4e2215ae$0$314$14726298@news.sunsite.dk...
>> On 7/16/2011 5:42 AM, Tony Johansson wrote:
>>> Can somebody give a good example when to use the p tag.
>>> I know it's a paragraph

>>
>> If you are sufficient XML oriented then you should have <p></p> around
>> all your text blocks.
>>
>> Arne
>>

> I mean if it's only static text I don't need any p tag


Then your page will not validate - http://validator.w3.org/
If your page does not validate then it might cause problems or not render as
you'd expect in some browsers, and bots might have problems. So, like Arne
has already posted, you should use them (correctly) all the time.
--
Brian Cryer
http://www.cryer.co.uk/brian




Axel Grude 01-25-2012 03:43 PM

Re: When to use the p tag in html
 
On 17/07/11 00:54, Tony Johansson wrote:
> "Arne Vajh°j"<arne@vajhoej.dk> skrev i meddelandet
> news:4e2215ae$0$314$14726298@news.sunsite.dk...
>> On 7/16/2011 5:42 AM, Tony Johansson wrote:
>>> Can somebody give a good example when to use the p tag.
>>> I know it's a paragraph

>>
>> If you are sufficient XML oriented then you should have<p></p> around
>> all your text blocks.
>>
>> Arne
>>
>>
>>

>
> I mean if it's only static text I don't need any p tag
>
> //Tony
>
>

use <p> when you want to create a block level element. There are an awful lot of
"Programmers" who use this pattern instead:

<table><tr>
<td> .... content ... </td>
</tr></table>
(*)

A perfect candidate to replace with <p>

<p> .... content ... </p>

Alternatively, you can use <div>...</div> if you are intending to have some nested
elements in there (and not just flowing text). <P> just means its more or less plain
text contained.

(*) And yes, I am serious, I have seen this pattern time and time again. Countless
tables that contained just one cell, all because people didn't know how to create or
style block level elements.

Ax


All times are GMT. The time now is 07:33 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.