Default padding

Discussion in 'HTML' started by UKuser, Feb 22, 2007.

  1. UKuser

    UKuser Guest

    Hi,

    Can someone tell me what the default margins & heights are for the p
    tag please.

    Thanks

    A
     
    UKuser, Feb 22, 2007
    #1
    1. Advertising

  2. UKuser

    John Hosking Guest

    UKuser wrote:
    >
    > Can someone tell me what the default margins & heights are for the p
    > tag please.


    Depends on the browser. They can all be different.

    Try 'em and see.

    --
    John
     
    John Hosking, Feb 22, 2007
    #2
    1. Advertising

  3. UKuser

    Andy Dingley Guest

    On 22 Feb, 11:26, "UKuser" <> wrote:

    > Can someone tell me what the default margins & heights are for the p
    > tag please.


    There are no "defaults" because there's no standard imposed on how
    browsers should treat this. It's up to the browser author.

    You might find this interesting though
    http://www.w3.org/TR/CSS21/sample.html
    It's a _suggested_ default style sheet for HTML.
    In it we find that
    p { margin: 1.12em 0; }

    Note that the CSS-defined initial values (in the absence of a
    stylesheeet) for padding are 0. These _are_ part of the formal
    normative recommendation, unlike the suggested default stylesheet.
    Also line-height has a normative initial value of "normal" which is
    recommended (again a flexible suggestion, like the stylesheet) to
    between 1.0 and 1.2. This fits with the default stylesheet value of
    initial top and bottom margins being "one line height" rather than "1
    em", as is often thought.

    In practice the default stylesheet can generally be assumed to apply
    to all desktop browsers, at least as far as it's _necessary_ to assume
    anything about it. Assume it will be reasonable and workable, unless
    you have a reason to start deliberately setting things differently.

    <p> will be rendered in much this way across all common browsers. <li>
    though is known to vary even between common browsers. Some default by
    setting biggger margins on it, others do it by setting padding. If you
    adjust either <li> settings, make sure that you take _both_ margin and
    padding into the explicit control of your stylesheet.

    Obviously it's all likely to be radically different for "non-
    traditional" browsers and display devices.
     
    Andy Dingley, Feb 22, 2007
    #3
    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. micky

    default.mspx or default.do

    micky, Dec 16, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    518
    Andrew Robinson
    Dec 17, 2005
  2. Gaetan
    Replies:
    3
    Views:
    1,481
    Juan T. Llibre
    Feb 14, 2006
  3. C Gillespie
    Replies:
    3
    Views:
    440
    Peter Hansen
    Mar 22, 2005
  4. Max
    Replies:
    2
    Views:
    515
    Joe Kesselman
    Aug 1, 2006
  5. Amr
    Replies:
    2
    Views:
    660
Loading...

Share This Page