Do you have to have <p>
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.
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 posted this at 03:10 — 16th June 2005.
She has: 840 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;
}
Roo
Renegade posted this at 06:50 — 16th June 2005.
He has: 3,022 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; }
Busy posted this at 11:24 — 16th June 2005.
He has: 6,151 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
Megan posted this at 13:17 — 16th June 2005.
She has: 11,421 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.
Megan
Connect with us on Facebook!
EGS posted this at 15:04 — 16th June 2005.
They have: 161 posts
Joined: Jan 2005
BAH!
I've been using two tags to do the job. Meh..
I'm not changing it now.
Roo posted this at 21:28 — 16th June 2005.
She has: 840 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 posted this at 22:48 — 16th June 2005.
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 posted this at 00:31 — 17th June 2005.
She has: 840 posts
Joined: Apr 1999
pr???
openmind posted this at 07:31 — 17th June 2005.
He has: 945 posts
Joined: Aug 2001
I mean
I was having a brain fart when I wrote that...
demonhale posted this at 04:00 — 17th June 2005.
He has: 3,278 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 posted this at 17:40 — 17th June 2005.
He has: 2,667 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.
Tim
http://www.tandswebdesign.com
IanD posted this at 23:56 — 21st June 2005.
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.
Fighting for a Lost Cause.net
dataNdesigns posted this at 08:52 — 22nd June 2005.
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.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.