CSS positioning help?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • timberlands
    Confirmed User
    • Sep 2005
    • 504

    #1

    CSS positioning help?

    Anyone know what the command is to position something on a page using only <div> tag and make it stay in its place when viewed at any resolution?

    for example at 1024 rez it moves slightly out of place and overlaps other things but at higher rez its ok.

    <DIV style="position: absolute; top:160px; left:15px; width:400px;">
    Promote 3dgirlz.com - The Ultimate Sex Game Software!

    3DGirlzCash: ICQ 431832000
    http://www.wickedworks.us
    Best.Damn.Web.Design
  • ssp
    Confirmed User
    • Jan 2005
    • 7990

    #2
    That's because you use an absolute position. Try using:

    position: relative;

    I advice you to read a free online tutorial on CSS positioning.

    Comment

    • timberlands
      Confirmed User
      • Sep 2005
      • 504

      #3
      ok thanx
      Promote 3dgirlz.com - The Ultimate Sex Game Software!

      3DGirlzCash: ICQ 431832000
      http://www.wickedworks.us
      Best.Damn.Web.Design

      Comment

      • jayeff
        Confirmed User
        • May 2001
        • 2944

        #4
        Try this: http://www.webreference.com/html/tutorial18/

        Absolute positioning can be valuable, but it is very tricky in most situations. For example, if your design is centered, you obviously cannot use absolute positioning in the horizontal, since the design will shift according to resolution (or rather, viewable browser width). The other big snag is that you cannot prevent Firefox (and other) users increasing font sizes, although there are ways to limit the chaos that can cause your layout.

        Usually it is best to go with (the default) relative positioning and "graduate" to absolute positioning once you are stronger on CSS and only then, if you must.

        Comment

        • potter
          Confirmed User
          • Dec 2004
          • 6559

          #5
          Try using margin to position it.

          Comment

          Working...