28 users online (1 members and 27 guests)  


  Results 1 to 8 of 8

Related

  1. Not working in IE    Forum: HTML Forum
    Replies: 2
  2. Setting Div widths    Forum: CSS Forum
    Replies: 0
  3. Replies: 3
  4. Why isn't this working?    Forum: HTML Forum
    Replies: 5
  5. It's 3:00 AM here and I'm working the .....    Forum: General Discussion
    Replies: 47
  1. #1
    jpcording's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2003
    Posts
    9

    CSS Percentage widths not working

    I'm trying to move away from tables and into CSS for my site layout. Biggest snag so far is that I've got everything working on one machine running IE 6, but when I move to another machine running IE5, the percentage widths are no longer recognized.

    I'm using div tags and controlling layout with, for example "margin-right:25%," for example.

    Here's the code:

    #left {position:absolute;top:120;display:inline;width:22%;z-index:20;}
    #mid {position:absolute;top:100;margin-left:27%;display:inline;width:58%;float:right;z-index:10;}
    #right{position:absolute;top: 250;display:inline;margin-left:85%;width:15%;float:right;z-index:5;}

    I can't imagine that IE5 doesn't support this. Any ideas about what the problem might be would be greatly appreciated.

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Hi there,

    When you say they are not recognised, do you mean they are completely ignored or are slightly different (enough to break them, for example)?

    The reason I ask is that IE 5* has a broken box-model compared to the w3 spec. They fixed (ish) this in IE6.

    If thats the case, try the Box-Model Hack http://tantek.com/CSS/Examples/boxmodelhack.html by Tantek Celik.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  3. #3
    jpcording's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2003
    Posts
    9
    When I view the page in IE5, all page elements (divs) are aligned left.

  4. #4
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    use text-align to align them where you wish
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  5. #5
    jpcording's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2003
    Posts
    9
    Forgive my lack of clarity. What I mean by aligned left is that every element the page is clumped together along the left edge, stacked one atop the other based on the z-index. The margin values are being ignored.

  6. #6
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    could you post a link to an example? its hard to visualise.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  7. #7
    jpcording's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2003
    Posts
    9
    Thanks for your replies. I fixed the problem by changing from margin-left, to simply "left" for the percentage width. My lingering question is, what's the functional difference?

  8. #8
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Good question.

    Not one I have used much myself, heres the standard - http://css.somepeople.net/css2ref/Standard/visuren.html#propdef-left

    I think its main difference is the differing way it behaves depending on whether its containing element is absolute or relatively positioned.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?



Tags for this Thread