471,618 Members | 1,481 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,618 software developers and data experts.

Amount of space after <p> paragraph tag.

I notice that the <ptag does not always allow the same amount of
space. Some websites have about half a line only. When I check their
code, they have used just <p>. On other occasions it seems that <p>
has left not just one line of space as per the current font size, but
as much as 20 or 30 pixels.

Can someone please explain to me how to control what <pdoes in terms
of space after a paragraph using a CSS.
Dec 3 '07 #1
5 11623
In article
<22**********************************@b40g2000prf. googlegroups.co
m>,
RetroMIDI <mu********@gmail.comwrote:
I notice that the <ptag does not always allow the same amount of
space. Some websites have about half a line only. When I check their
code, they have used just <p>. On other occasions it seems that <p>
has left not just one line of space as per the current font size, but
as much as 20 or 30 pixels.

Can someone please explain to me how to control what <pdoes in terms
of space after a paragraph using a CSS.
You can control this by setting your own margin and padding on
paragraphs instead of letting the individual browsers set their
own styles. Need an example?

--
dorayme
Dec 3 '07 #2

"RetroMIDI" <mu********@gmail.comwrote in message
news:22**********************************@b40g2000 prf.googlegroups.com...
>I notice that the <ptag does not always allow the same amount of
space. Some websites have about half a line only. When I check their
code, they have used just <p>. On other occasions it seems that <p>
has left not just one line of space as per the current font size, but
as much as 20 or 30 pixels.

Can someone please explain to me how to control what <pdoes in terms
of space after a paragraph using a CSS.
Here's my 'standard' p redefinition that you can play with/modify to suit:

p {
padding: 0;
margin-top: 0;
margin-right: 0;
margin-bottom: 1em;
margin-left: 0;
}

What does it do? It stops all padding and margins for all p tags, and adds a
1em margin to the bottom.

It's important that you do not use pixel spacings for (at least) textual
elements. If the viewer changes their viewable font size, it is desirable
that any white space also changes to suit.

Dec 3 '07 #3
On 3 Dec, 00:01, RetroMIDI <murray....@gmail.comwrote:
I notice that the <ptag does not always allow the same amount of
space.
It has however much space you specify in CSS, together with the notes
on how these CSS rules should be interpreted.

One aspect that hasn't been mentioned here is "collapsing vertical
margins".

Read all about it here:
http://brainjar.com/css/positioning/

Dec 3 '07 #4
On 2 déc, 19:44, dorayme <doraymeRidT...@optusnet.com.auwrote:
In article
<22ff74cf-76f8-4770-bfc6-b1fea5b8c...@b40g2000prf.googlegroups.co
m>,

RetroMIDI <murray....@gmail.comwrote:
I notice that the <ptag does not always allow the same amount of
space. Some websites have about half a line only. When I check their
code, they have used just <p>. On other occasions it seems that <p>
has left not just one line of space as per the current font size, but
as much as 20 or 30 pixels.
Can someone please explain to me how to control what <pdoes in terms
of space after a paragraph using a CSS.

You can control this by setting your own margin and padding on
paragraphs instead of letting the individual browsers set their
own styles. Need an example?

--
dorayme

Hello all,

Sometimes, it's due to a bug too...

http://www.gtalbot.org/BrowserBugsSe...arginAuto.html

http://www.gtalbot.org/BrowserBugsSe...Disappear.html

Gérard
Dec 4 '07 #5
In article
<31**********************************@o6g2000hsd.g ooglegroups.com
>,
GTalbot <ne*******@gtalbot.orgwrote:
On 2 déc, 19:44, dorayme <doraymeRidT...@optusnet.com.auwrote:
Can someone please explain to me how to control what <pdoes in
terms
of space after a paragraph using a CSS.
You can control this by setting your own margin and padding on
paragraphs instead of letting the individual browsers set their
own styles. Need an example?
Sometimes, it's due to a bug too...
>
http://www.gtalbot.org/BrowserBugsSe...WithMarginAuto
.html

http://www.gtalbot.org/BrowserBugsSe...nDisappear.htm
l
I have bookmarked your extremely useful:

http://www.gtalbot.org/BrowserBugsSection/

--
dorayme
Dec 4 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Jim Fischer | last post: by
2 posts views Thread by Donald Firesmith | last post: by
27 posts views Thread by dip | last post: by
11 posts views Thread by Squeamizh | last post: by
3 posts views Thread by ajay2552 | last post: by
13 posts views Thread by Sebastian Faust | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.