CSS simple question?

Discussion in 'HTML' started by hzgt9b, Nov 21, 2007.

  1. hzgt9b

    hzgt9b Guest

    Using CSS I want to center a DIV on the page and always keep it 3px
    from the top. Seems simple but I cannot find a cross-browser solution
    to this problem. I can get to work in IE or FF but not both w/o
    relaxing the 3px from the top constraint. Can someone offer a solution
    to this problem?
     
    hzgt9b, Nov 21, 2007
    #1
    1. Advertising

  2. On Nov 21, 10:12 am, hzgt9b <> wrote:
    > Using CSS I want to center a DIV on the page and always keep it 3px
    > from the top. Seems simple but I cannot find a cross-browser solution
    > to this problem. I can get to work in IE or FF but not both w/o
    > relaxing the 3px from the top constraint. Can someone offer a solution
    > to this problem?


    With out a URL to see what you are doing I will just have to guess
    what you code looks like. So I say you are missing a ":" in the CSS.

    Any one else want to take a guess?
     
    Travis Newbury, Nov 21, 2007
    #2
    1. Advertising

  3. Travis Newbury wrote:

    > <> wrote:
    >> Using CSS I want to center a DIV on the page and always keep it 3px
    >> from the top. Seems simple but I cannot find a cross-browser
    >> solution to this problem. I can get to work in IE or FF but not both
    >> w/o relaxing the 3px from the top constraint. Can someone offer a
    >> solution to this problem?

    >
    > With out a URL to see what you are doing I will just have to guess
    > what you code looks like. So I say you are missing a ":" in the CSS.
    >
    > Any one else want to take a guess?


    Three pixels, eh?
    http://www.positioniseverything.net/explorer/threepxtest.html ?

    But as you say, Travis, without a URL to the page, everything is a
    guess.

    --
    -bts
    -Motorcycles defy gravity; cars just suck
     
    Beauregard T. Shagnasty, Nov 21, 2007
    #3
  4. hzgt9b

    dorayme Guest

    In article
    <XRY0j.126749$>,
    "Beauregard T. Shagnasty" <> wrote:

    > Travis Newbury wrote:
    >
    > > <> wrote:
    > >> Using CSS I want to center a DIV on the page and always keep it 3px
    > >> from the top. Seems simple but I cannot find a cross-browser
    > >> solution to this problem. I can get to work in IE or FF but not both
    > >> w/o relaxing the 3px from the top constraint. Can someone offer a
    > >> solution to this problem?

    > >
    > > With out a URL to see what you are doing I will just have to guess
    > > what you code looks like. So I say you are missing a ":" in the CSS.
    > >
    > > Any one else want to take a guess?

    >
    > Three pixels, eh?
    > http://www.positioniseverything.net/explorer/threepxtest.html ?
    >
    > But as you say, Travis, without a URL to the page, everything is a
    > guess.


    I'll bite. If it is a vertical margin, I would say to make sure
    you zero margins and paddings, up to but not necessarily as
    drastic as

    * {margin: 0; padding:0;}

    and then set explicit margins and that way you will increase your
    chances of browsers behaving similarly.

    --
    dorayme
     
    dorayme, Nov 21, 2007
    #4
    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. Eric
    Replies:
    4
    Views:
    734
    clintonG
    Dec 24, 2004
  2. Replies:
    6
    Views:
    554
    Jonathan N. Little
    Mar 18, 2006
  3. AF
    Replies:
    17
    Views:
    602
    Nije Nego
    Aug 9, 2006
  4. Replies:
    29
    Views:
    885
    Ben C
    Mar 21, 2008
  5. richard
    Replies:
    12
    Views:
    757
    dorayme
    Mar 9, 2010
Loading...

Share This Page