Different padding different browser

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

    Different padding different browser

    try the following code in IE and Mozila and you get 2 different padding

    <fieldset>
    <legend>This is a test</legend>
    <div style=padding:1 0px>hello</div>
    </fieldset>

    HOW CAN I AVOID THIS ?

    thanks


  • Chris Leipold

    #2
    Re: Different padding different browser

    Mel wrote:[color=blue]
    > try the following code in IE and Mozila and you get 2 different padding
    >
    > <fieldset>
    > <legend>This is a test</legend>
    > <div style=padding:1 0px>hello</div>
    > </fieldset>
    >
    > HOW CAN I AVOID THIS ?[/color]

    google a bit for legend and fieldset. It's a beast...
    But in your example the paddings and margins of fieldset, legend and div
    (and under circumstances the contents of div) will change the padding.

    Chris

    Comment

    • Harlan Messinger

      #3
      Re: Different padding different browser


      "Mel" <mel.m.heravi@h p.com> wrote in message
      news:41dc1911$1 @usenet01.boi.h p.com...[color=blue]
      > try the following code in IE and Mozila and you get 2 different padding
      >
      > <fieldset>
      > <legend>This is a test</legend>
      > <div style=padding:1 0px>hello</div>
      > </fieldset>
      >
      > HOW CAN I AVOID THIS ?[/color]

      Your DIV tag has a STYLE attribute whose value is "padding:" and then
      another, invalid attribute named "10px" without a value assigned to it. Use
      quotes to delimit attribute values, and you won't have this problem.

      Comment

      • Michael Winter

        #4
        Re: Different padding different browser

        On Wed, 5 Jan 2005 12:42:58 -0500, Harlan Messinger
        <h.messinger@co mcast.net> wrote:
        [color=blue]
        > "Mel" <mel.m.heravi@h p.com> wrote in message
        > news:41dc1911$1 @usenet01.boi.h p.com...[/color]

        [snip]
        [color=blue][color=green]
        >> <div style=padding:1 0px>hello</div>[/color][/color]

        [snip]
        [color=blue]
        > Use quotes to delimit attribute values, and you won't have this problem.[/color]

        That was my first impression, too. However, attribute values don't need to
        be quoted if they only contain letters, digits, hyphens, periods,
        underscores and colons. As the one in question does, it *should* be OK.
        I'd have thought that the problem is more likely to be different
        margin/padding combinations across all of the elements involved.

        Mike

        --
        Michael Winter
        Replace ".invalid" with ".uk" to reply by e-mail.

        Comment

        • Neal

          #5
          Re: Different padding different browser

          Michael Winter <M.Winter@bluey onder.co.invali d> wrote:
          [color=blue]
          > Harlan Messinger <h.messinger@co mcast.net> wrote:[/color]
          [color=blue][color=green]
          >> Use quotes to delimit attribute values, and you won't have this
          >> problem.[/color]
          >
          > That was my first impression, too. However, attribute values don't
          > need to be quoted if they only contain letters, digits, hyphens,
          > periods, underscores and colons. As the one in question does, it
          > *should* be OK.[/color]

          Not agreeing nor disagreeing, yet quoting attributes is still a very
          good habit to develop. Might not actually fix this problem, but it's
          certainly a good suggestion.

          Comment

          • Harlan Messinger

            #6
            Re: Different padding different browser


            "Michael Winter" <M.Winter@bluey onder.co.invali d> wrote in message
            news:opsj45fa06 x13kvk@atlantis ...[color=blue]
            > On Wed, 5 Jan 2005 12:42:58 -0500, Harlan Messinger
            > <h.messinger@co mcast.net> wrote:
            >[color=green]
            > > "Mel" <mel.m.heravi@h p.com> wrote in message
            > > news:41dc1911$1 @usenet01.boi.h p.com...[/color]
            >
            > [snip]
            >[color=green][color=darkred]
            > >> <div style=padding:1 0px>hello</div>[/color][/color]
            >
            > [snip]
            >[color=green]
            > > Use quotes to delimit attribute values, and you won't have this problem.[/color]
            >
            > That was my first impression, too. However, attribute values don't need to
            > be quoted if they only contain letters, digits, hyphens, periods,
            > underscores and colons. As the one in question does, it *should* be OK.[/color]

            My mistake. But, to digress, the line in the spec that follows the one you
            paraphrase above says, "We recommend using quotation marks even when it is
            possible to eliminate them." The reason for this is ease of reading and
            maintenance, and here was a case where that came into play, because as the
            code appeared on my screen, I thought there was a space after the colon. If
            the value were quoted, I wouldn't have looked twice because the space
            wouldn't have mattered even if it were there.

            Just out of curiosity, though: what if you *tried* it to see if it fixed the
            problem? It may be a browser bug.
            [color=blue]
            > I'd have thought that the problem is more likely to be different
            > margin/padding combinations across all of the elements involved.[/color]

            Comment

            Working...