Amount of space after <p> paragraph tag.

Discussion in 'HTML' started by RetroMIDI, Dec 3, 2007.

  1. RetroMIDI

    RetroMIDI Guest

    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.
     
    RetroMIDI, Dec 3, 2007
    #1
    1. Advertising

  2. RetroMIDI

    dorayme Guest

    In article
    <
    m>,
    RetroMIDI <> 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
     
    dorayme, Dec 3, 2007
    #2
    1. Advertising

  3. RetroMIDI

    asdf Guest

    "RetroMIDI" <> wrote in message
    news:...
    >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.
     
    asdf, Dec 3, 2007
    #3
  4. RetroMIDI

    Andy Dingley Guest

    On 3 Dec, 00:01, RetroMIDI <> 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/
     
    Andy Dingley, Dec 3, 2007
    #4
  5. RetroMIDI

    GTalbot Guest

    On 2 déc, 19:44, dorayme <> wrote:
    > In article
    > <
    > m>,
    >
    > RetroMIDI <> 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/BrowserBugsSection/MSIE7Bugs/OrdinaryPargWithMarginAuto.html

    http://www.gtalbot.org/BrowserBugsSection/MSIE7Bugs/DefaultMarginDisappear.html

    Gérard
     
    GTalbot, Dec 4, 2007
    #5
  6. RetroMIDI

    dorayme Guest

    In article
    <
    >,

    GTalbot <> wrote:

    > On 2 déc, 19:44, dorayme <> 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/BrowserBugsSection/MSIE7Bugs/OrdinaryPargWithMarginAuto
    > .html
    >
    > http://www.gtalbot.org/BrowserBugsSection/MSIE7Bugs/DefaultMarginDisappear.htm
    > l


    I have bookmarked your extremely useful:

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

    --
    dorayme
     
    dorayme, Dec 4, 2007
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. shruds
    Replies:
    1
    Views:
    893
    John C. Bollinger
    Jan 27, 2006
  2. Shuo Xiang

    Stack space, global space, heap space

    Shuo Xiang, Jul 9, 2003, in forum: C Programming
    Replies:
    10
    Views:
    2,955
    Bryan Bullard
    Jul 11, 2003
  3. Christian Seberino
    Replies:
    21
    Views:
    1,764
    Stephen Horne
    Oct 27, 2003
  4. Ian Bicking
    Replies:
    2
    Views:
    1,078
    Steve Lamb
    Oct 23, 2003
  5. dorayme
    Replies:
    112
    Views:
    2,822
    dorayme
    Mar 30, 2009
Loading...

Share This Page