Ezilon.com - Target Your Audience, be Seen in Your Region

Do you have to have <p>

You are viewing this site as a guest. Join our community to get your questions answered and share knowledge. Active members may advertise and ask for a website critique.
teammatt3's picture
Moderator

He has: 1,907 posts

Joined: Sep 2003

Simple question, when you have text on a web page do you have to have tags around it? I ask because when I have the p tags I get a big space above the word.

Roo's picture
Developer

She has: 836 posts

Joined: Apr 1999

You *should* have paragraph tags yes. It helps to keep text where it belongs and makes a page organized and neat.

You can specify space thought by using line height for the p tags in your css like so:

p {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
line-height: 16px;
color: black;
}

Renegade's picture
Moderator

He has: 2,944 posts

Joined: Oct 2002

You can also specify the space you are seeing above and below the paragraph with it's margins

p { margin: 0.5em; }

Cheng Eu Chew - Renegade
Download:
- Mozilla, Firefox
- Opera
This post may contain peanut traces

Busy's picture
Modrater

He has: 6,157 posts

Joined: May 2001

is paragraph, is line break (new line)

one is equals to two 's

I personally always just use 's, never liked using for some reason

<?bhb if(broken){ echo("It wasn't me Smiling "); } ?>
Learn HTML the ez way - EzHTML.net

Some people are like slinkies, they dont really serve any purpose but they still bring a smile to your face when you push them down the stairs ...

Megan's picture
Administrator

She has: 10,304 posts

Joined: Jun 1999

Paragraphs are proper structure for paragraphs of text. It's like any other HTML element - use it properly! Using 's to make paragraphs is like using or to make headings, or as is oft discussed, using tables to make layouts. Works, but is incorrect. If you've got a bit of text that is not quite a paragraph I don't think it's so clear. If it's not a paragraph, what is it? Is it a heading? Is it a list? Use the tags that most accurately descirbe the element. Like Roo & Renegade said, you can then use CSS to fix the spacing.

They have: 168 posts

Joined: Jan 2005

BAH!

I've been using two tags to do the job. Meh..

I'm not changing it now. Sticking out tongue

Roo's picture
Developer

She has: 836 posts

Joined: Apr 1999

Ummm.... is XHTML where is HTML 4X....A isn't going to make two line breaks. As said above, you're better off using paragraph tags anyway.

openmind's picture

He has: 945 posts

Joined: Aug 2001

I'm getting into the habit now of using pr instead of br. Makes for a much better formatted page IMHO...

Roo's picture
Developer

She has: 836 posts

Joined: Apr 1999

pr??? Confused

openmind's picture

He has: 945 posts

Joined: Aug 2001

Roo wrote: pr??? Confused

I mean

I was having a brain fart when I wrote that...

demonhale's picture

He has: 3,301 posts

Joined: May 2005

I sometimes use , for some unique purpose... but most of the time, I wrap a paragraph in divs... (better to get accustomed to using )... Well its your choice anyways...

timjpriebe's picture
DeveloperModeratorSponsor

He has: 2,666 posts

Joined: Dec 2004

is one of those things that in the long run is the better way to do things. Combined with CSS, of course. isn't terrible, but if it is a paragraph, you're better off training yourself to use . It's more flexible when combined with CSS.

It can obviously be a pain to change your habits like that. I speak from experience, having only recently switched over to more properly coded HTML with CSS.

They have: 222 posts

Joined: Sep 1999

I usually create a class just for the first paragraph in a document that has the top margin set to -5px, that way I can use ... and not get the extra space above the first paragraph.

dataNdesigns's picture

He has: 79 posts

Joined: Jun 2005

a tag will give you much more flexability ongoing, the others are correct in saying you should try to use it, also you can use settings within the p tag when needed later.

I personally like them as it opens and closes as per XML and creates nice nesting. great for adding classes into as well. Moreover, you it will find it easier to use ongoing rather than 2 br's.

Stu
late nights = no life and too much pizza
dataNdesigns.com.au