|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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
|
||||
|
||||
|
I think the solution to both of your problems is solved by creating a container and sizing the children per the parent.
|
|
#3
|
||||
|
||||
|
__________________
# Jeremy Explain your problem instead of asking how to do what you decided was the solution. |
|
#4
|
||||
|
||||
|
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 |
|
#5
|
|||
|
|||
|
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? |
|
#6
|
|||
|
|||
|
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) |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > CSS Layouts |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|