padding and margin units

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • shapper

    padding and margin units

    Hello,

    I always use EM for text size, letter spacing and line heights.
    For DIV widths I usually use PIXELS if fixed width web site and
    PERCENT if fluid layout web site.

    I think in both cases I am doing the right thing ... I think.

    But what unit should I use for padding and margin? EM? PIXEL?

    Thanks,
    Miguel
  • dorayme

    #2
    Re: padding and margin units

    In article
    <195ae751-1de2-43f6-b81a-a3b90e07f3ee@b6 4g2000hsa.googl egroups.com>,
    shapper <mdmoura@gmail. comwrote:
    Hello,
    >
    I always use EM for text size, letter spacing and line heights.
    You should at least stop doing this in the case of line-height.
    For DIV widths I usually use PIXELS if fixed width web site and
    PERCENT if fluid layout web site.
    >
    I think in both cases I am doing the right thing ... I think.
    >
    If you use fixed width of px for a div and the content is wider than the
    div, it will look ugly and/or broken
    But what unit should I use for padding and margin? EM? PIXEL?
    >
    It depends on the context. Post a url of something you are unsure about.

    --
    dorayme

    Comment

    • Jukka K. Korpela

      #3
      Re: padding and margin units

      Scripsit shapper:
      I always use EM for text size, letter spacing and line heights.
      Good for you and your visitors, if you use reasonable values. However,
      line-height is best set as a pure number, for inheritance-related
      technical reasons.
      For DIV widths I usually use PIXELS if fixed width web site
      Why would you suddenly spoil everything and set a fixed width in pixels?
      Suppose you set a width of 800 pixels; how many characters will fit in,
      horizontally? The only correct answer is "I don't know" or "It depends".
      But what unit should I use for padding and margin? EM? PIXEL?
      The answer is obvious if you think _why_ you use the em unit for text
      size and related matters, assuming you understand the reason and aren't
      just following some guideline without knowing why.

      --
      Jukka K. Korpela ("Yucca")


      Comment

      • shapper

        #4
        Re: padding and margin units

        On May 6, 2:05 am, dorayme <doraymeRidT... @optusnet.com.a uwrote:
        In article
        <195ae751-1de2-43f6-b81a-a3b90e07f...@b6 4g2000hsa.googl egroups.com>,
        >
        shapper <mdmo...@gmail. comwrote:
        Hello,
        >
        I always use EM for text size, letter spacing and line heights.
        >
        You should at least stop doing this in the case of line-height.
        >
        For DIV widths I usually use PIXELS if fixed width web site and
        PERCENT if fluid layout web site.
        >
        I think in both cases I am doing the right thing ... I think.
        >
        If you use fixed width of px for a div and the content is wider than the
        div, it will look ugly and/or broken
        >
        But what unit should I use for padding and margin? EM? PIXEL?
        >
        It depends on the context. Post a url of something you are unsure about.
        >
        --
        dorayme
        "You should at least stop doing this in the case of line-height."

        Yes, I understood that one hour ago. It also seems the CSS validator
        has some problems with unitless values so I need to use 1.0 instead of
        1.

        Thanks,
        Miguel

        Comment

        • shapper

          #5
          Re: padding and margin units

          On May 6, 7:22 am, "Jukka K. Korpela" <jkorp...@cs.tu t.fiwrote:
          Scripsit shapper:
          >
          I always use EM for text size, letter spacing and line heights.
          >
          Good for you and your visitors, if you use reasonable values. However,
          line-height is best set as a pure number, for inheritance-related
          technical reasons.
          >
          For DIV widths I usually use PIXELS if fixed width web site
          >
          Why would you suddenly spoil everything and set a fixed width in pixels?
          Suppose you set a width of 800 pixels; how many characters will fit in,
          horizontally? The only correct answer is "I don't know" or "It depends".
          >
          But what unit should I use for padding and margin? EM? PIXEL?
          >
          The answer is obvious if you think _why_ you use the em unit for text
          size and related matters, assuming you understand the reason and aren't
          just following some guideline without knowing why.
          >
          --
          Jukka K. Korpela ("Yucca")http://www.cs.tut.fi/~jkorpela/
          Yes, I understand the reason ... with EM when text size increases so
          it will the padding and margin.

          About the fluid versus fixed ... in the web site I am building I have
          two requirements:

          1. The web site has a flash movie which should expand all width of the
          layout.
          To be honest I don't know if a Flash movie should be expanded or
          not.

          2. The web site must display flash papers documents online.
          I need to display the Flash Paper documents with at least 800px
          width.
          Again I also don't know if I should make the design fluid with
          Flash documents in it.

          These are the reasons why I am using Fixed Layout instead of Fluid
          Layout.
          Not sure if I am taking the right option but ...

          Anyway, any suggestion is welcome.

          I have been always reading about Elastic layouts. Does everyone use
          it?

          Thanks,
          Miguel

          Comment

          • Jukka K. Korpela

            #6
            Re: padding and margin units

            Scripsit shapper:
            "You should at least stop doing this in the case of line-height."
            You're supposed to quote just the relevant part, instead of a fullquote
            _and_ a quotation of the relevant part. Google for "how I quote on
            Usenet".
            Yes, I understood that one hour ago.
            OK. What were we supposed to get from this information?
            It also seems the CSS validator
            has some problems with unitless values so I need to use 1.0 instead of
            1.
            What? You seem to have misunderstood something completely. Changing
            values in your style sheet just to deal with an assumed CSS Validator
            bug is perverse.

            Then again, if this is still about line-height, then 1.0 is almost
            always too small for any normal text, but so is 1.1, except perhaps for
            fonts like Calibri that utilize, on average, a fairly small part of the
            height of the font.

            --
            Jukka K. Korpela ("Yucca")


            Comment

            Working...