Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Amount of space after <p> paragraph tag.

Reply
Thread Tools

Amount of space after <p> paragraph tag.

 
 
RetroMIDI
Guest
Posts: n/a
 
      12-03-2007
I notice that the <p> tag 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 <p> does in terms
of space after a paragraph using a CSS.
 
Reply With Quote
 
 
 
 
dorayme
Guest
Posts: n/a
 
      12-03-2007
In article
<(E-Mail Removed)
m>,
RetroMIDI <(E-Mail Removed)> wrote:

> I notice that the <p> tag 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 <p> does 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
 
Reply With Quote
 
 
 
 
asdf
Guest
Posts: n/a
 
      12-03-2007

"RetroMIDI" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I notice that the <p> tag 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 <p> does 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.



 
Reply With Quote
 
Andy Dingley
Guest
Posts: n/a
 
      12-03-2007
On 3 Dec, 00:01, RetroMIDI <(E-Mail Removed)> wrote:
> I notice that the <p> tag 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/

 
Reply With Quote
 
GTalbot
Guest
Posts: n/a
 
      12-04-2007
On 2 déc, 19:44, dorayme <(E-Mail Removed)> wrote:
> In article
> <(E-Mail Removed)
> m>,
>
> RetroMIDI <(E-Mail Removed)> wrote:
> > I notice that the <p> tag 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 <p> does 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
 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      12-04-2007
In article
<(E-Mail Removed)
>,

GTalbot <(E-Mail Removed)> wrote:

> On 2 déc, 19:44, dorayme <(E-Mail Removed)> wrote:


Can someone please explain to me how to control what <p> does 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why choose a paragraph element for a paragraph? dorayme HTML 112 03-30-2009 10:56 PM
Last line in paragraph has extra space - cannot get rid of it ZZZupan ASP General 3 09-22-2004 09:38 AM
Why Python style guide (PEP-8) says 4 space indents instead of 8 space??? 8 space indents ever ok?? Christian Seberino Python 21 10-27-2003 04:20 PM
Re: Why Python style guide (PEP-8) says 4 space indents instead of8 space??? 8 space indents ever ok?? Ian Bicking Python 2 10-23-2003 07:07 AM
Stack space, global space, heap space Shuo Xiang C Programming 10 07-11-2003 07:30 PM



Advertisments