Thread: CSS Layouts

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Posts
    4
    Rep Power
    0

    CSS Layouts


    I've been thinking about switching over to making table-less css layouts, but there's been a few things holding me back, as I'm not sure if they're possible.

    Firstly, can you have two fixed width divs on the sides of a variable width div, which will stretch to fit the screen? Something like this is generally what I mean:

    Code:
    <div style="width: 50px; float: left;">left</div>
    <div style="width: *; float: left;">middle</div>
    <div style="width: 50px; float: left;">right</div>
    Also, is there any way to make a div that has been placed to the right of another match the height of the the one to it's left? Basically, I want it to behave more like standard tables do in that every cell in a row is the same height. Is this possible?
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    USA
    Posts
    140
    Rep Power
    12
    I think the solution to both of your problems is solved by creating a container and sizing the children per the parent.
  4. #3
  5. mod_dev_shed
    Devshed Supreme Being (6500+ posts)

    Join Date
    Sep 2002
    Location
    Atlanta, GA
    Posts
    14,817
    Rep Power
    1100
    # Jeremy

    Explain your problem instead of asking how to do what you decided was the solution.
  6. #4
  7. |<.+#f@#+.&.|
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2002
    Location
    norway
    Posts
    3,009
    Rep Power
    1224
    Code:
    <div style="width: 50px; float: left;">left</div>
    <div style="width: 50px; float: right;">right</div>
    <div style="margin-left:50px; margin-right:50px;">middle</div>
    this should work
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Posts
    4
    Rep Power
    0
    alright, the margin-left & margin-right thing definitely seems like it should work. thanks.

    there's still the problem of the height, though. or could i do something along the same lines? put both divs in a container, and set their top & bottom margins to 0?
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2004
    Location
    Melbourne Australia
    Posts
    15
    Rep Power
    0

    CSS Reading - May help!


    http://www.bigbaer.com/reference/glossary_css.htm

    A friend I have never met, but am in awe of........ (non-commercial)

IMN logo majestic logo threadwatch logo seochat tools logo