Div Positioning problem

Discussion in 'CSS' started by tekboi, Feb 14, 2009.

  1. #1
    Okay, I have another question for you guys.

    I have a tile-able image I'm using as my background. It's coded in html. And i have the content such as pictures, flash, placed using AP divs. The problem with this is that when I resize my browser, the divs move along with the screen of course.

    When changing my div position from "absolute" to "relative", why do my divs break away and shift out of place?

    Is there a way to get around this, or do I need to re-adjust all of my divs? And how do I get them to look the same in all browsers. The divs are shifted different places on different browsers.
     
    tekboi, Feb 14, 2009 IP
  2. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #2
    From your description, it is obvious that you have no clue how absolute and relative positioning work. Please go to htmldog, and work through their tutorials. That will broaden your knowledge base enough to understand what you're doing.

    When you post back, give us a link or the html/css you're using, along with a sketch of how the layout should look.

    cheers,

    gary
     
    kk5st, Feb 14, 2009 IP
  3. tekboi

    tekboi Active Member

    Messages:
    59
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #3
    Well, the absolute positioning of items causes them to have a definite position that doesn't move with the browser right? And having a relative position on items allows them to move about the page when the browsers is resized right?

    what am I missing here?
     
    tekboi, Feb 14, 2009 IP
  4. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #4
    Everything? Absolute positioning takes the element out of the flow, and positions it relative to its nearest positioned ancestor. Relative positioning is in the flow, and is positioned relative to itself. The offset element is out of the flow, while its original in flow position is preserved.

    Did you study the tutorials? No? I thought not.

    gary
     
    kk5st, Feb 14, 2009 IP
  5. ToLynn.com

    ToLynn.com Banned

    Messages:
    47
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    If you don't know much about making layouts in DIV + CSS and you are trying to get things done, try tables. They are always a breeze for beginners. Do you have any IDE like MS expression web or dreamweaver?

    Tables aren't evil just you miss a lot by relying on them too much for page structure.
     
    ToLynn.com, Feb 15, 2009 IP
  6. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #6
    @ ToLynn.com: That is particularly bad advice.

    gary
     
    kk5st, Feb 15, 2009 IP
  7. mortgageloan

    mortgageloan Peon

    Messages:
    339
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    using tables is nt a very good option actually...
     
    mortgageloan, Feb 15, 2009 IP
  8. tekboi

    tekboi Active Member

    Messages:
    59
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #8
    ^ I already know NOT to use tables. CSS gives me more control over my web page. And even though I understand about div positioning, I'm still having a problem positioning things with my div without i screwing everything up.
     
    tekboi, Feb 18, 2009 IP
  9. tekboi

    tekboi Active Member

    Messages:
    59
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #9
    I will post my cod up in a second
     
    tekboi, Feb 18, 2009 IP
  10. tekboi

    tekboi Active Member

    Messages:
    59
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91