absolute positioning

Discussion in 'CSS' started by mnymkr, Apr 22, 2006.

  1. #1
    is absolute positioning taboo. i see so float used so much more?
     
    mnymkr, Apr 22, 2006 IP
  2. the_pm

    the_pm Peon

    Messages:
    332
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    0
    #2
    The one major flaw with absolute positioning is that it does a poor job of accommodating differences in visitor text size preferences. There are times position:absolute can be very useful, such as within DHTML menus, but for everyday layout practices, I personally tend to find it quite lacking. Floating, margins and stacking elements is typically all a Web page needs, even the most visually complex pages.
     
    the_pm, Apr 22, 2006 IP
  3. johneva

    johneva Well-Known Member

    Messages:
    1,480
    Likes Received:
    46
    Best Answers:
    1
    Trophy Points:
    170
    #3
    Well put there the_pm ;)
     
    johneva, Apr 22, 2006 IP
  4. mnymkr

    mnymkr Well-Known Member

    Messages:
    2,328
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    120
    #4
    so is margins more viable then padding? which has the greater difference cross browser.
     
    mnymkr, Apr 22, 2006 IP
  5. the_pm

    the_pm Peon

    Messages:
    332
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Margins make more sense, because if you're trying to position an element somewhere on the page and you want to create space for it, you are in fact pushing the entire object in a certain direction. Using padding means you are not repositioning the object itself, but its internal contents, which is typically not what you really want to do. Therefore, margins are a more accurate way to achieve your objective.

    Oh, and margins are more consistent across browsers ;) (minus little things like the 3-pixel jog or margin doubling on floated objects in IE, but these are VERY easy to overcome)
     
    the_pm, Apr 22, 2006 IP