Take a look at this picture and you'll understand my question easily:
http://www.myonlinephotoalbum.net/homepage.jpg
I got three <div>-elements by the side of each other. Two of them have a
fixed-with, but the last one shall rezise so the total browser-width is
used. How can I make a <div> rezise like that?
/Joakim
"Jocke" <joakim...@home.se> schreef in bericht news:ejn6n9#gCHA.2448@tkmsftngp11...
"Cybarber" <luc...@emergo.nl> skrev i meddelandet news:OsMYa9$gCHA.1324@tkmsftngp11...
"Jocke" <joakim...@home.se> schreef in bericht news:O4vo19AhCHA.4128@tkmsftngp08...
This is my favorite solution:
body {
margin-right: 100px;
margin-left: 100px;
padding:0px;
}
#centerlayer{
background-color:#00FF00;
width: 100%
}
#leftlayer{
background-color:#FF0000;
position:absolute;
width: 100px;
top: 0px;
left: 0px;
}
#rightlayer{
background-color:#0000FF;
position:absolute;
width: 100px;
top: 0px;
right: 0px;
}
this way the left and right column are positioned outside of the body area, and
the center column can expand to 100% of the body without necessity for any
expression
fabrizio
"Cybarber" <luc...@emergo.nl> wrote in message
news:eg62E0diCHA.2580@tkmsftngp12...
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/css/reference
/attributes.asp
http://msdn.microsoft.com/workshop/author/dhtml/reference/dhtml_reference_entry.
> better don't use expression, it's a IE only feature, it's not CSS.
> There are many other ways to do this using plain CSS.
>
> This is my favorite solution:
> [ yadda yadda yadda ]
>
> fabrizio
Sorry, I tried your "solution" on three different browsers, and different
versions of each. The results were different for each one. Sure the <div> is
centered, but there are so many other side-effects that it makes CSS look
like a joke. That's not what CSS is supposed to be.
Paul
But for other, more standard complaint browsers, this can work. Ok, you'll
probably need to fix different problem, I gave you the idea for how this can be
done, not a complete layout...
try looking here, you will find something fully working (and if this can't work
for you, tell us which browser and what it does wrong, please)
http://bluerobot.com/web/layouts/layout3.html
http://www.thenoodleincident.com/tutorials/box_lesson/boxes.html
regards
fabrizio
"Paul A. Scott" <psc...@skycoast.us> wrote in message
news:B9FB01EA.11B1A%psc...@skycoast.us...
Well, for starters, just look at the difference between IE-Mac 5.2.2 (which
keeps everything on one line but doesn't get all the colors), and IE-Win 6.0
(which gets the colors right, but flows the middle div onto a separate line.
Paul
really? never heard of this bug, strange... but are you sure you tried with a
correct html? A good css always need a standard complaint html with a good
doctype to work ;-)
This bug sound interesting, can you try opening the html I'm posting here and
post a screenshot of your renderering?
> and IE-Win 6.0
> (which gets the colors right, but flows the middle div onto a separate line.
>
of course, if you don't remove top-margin from body... that's correct. Try with
the complete xhtml here:
--// cut here //--
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=ISO-8859-1" />
<title>3 layers</title>
<style type="text/css">
body {
margin: 0 100px 0 100px;
padding:0 0 0 0;
}
#centerlayer{
background-color: #00FF00;
width: 100%
}
#leftlayer{
background-color: #FF0000;
position:absolute;
width: 100px;
top: 0px;
left: 0px;
}
#rightlayer{
background-color: #0000FF;
position:absolute;
width: 100px;
top: 0px;
right: 0px;
}
</style>
</head>
<body>
<div id="centerlayer">center</div>
<div id="leftlayer">left</div>
<div id="rightlayer">right</div>
</body>
</html>
--// cut here //--
fabrizio
I used exactly your posted CSS, and XHTML strict DOCTYPE calling the
multiple <DIV> in a logical manner.
>
> This bug sound interesting, can you try opening the html I'm posting here and
> post a screenshot of your renderering?
See: http://skycoast.us/fabrizio/
Look at fabrizio1.html--as you can see, there is a difference between IE Mac
5.2.2 and IE Win 6.0.
>> and IE-Win 6.0
>> (which gets the colors right, but flows the middle div onto a separate line.
> of course, if you don't remove top-margin from body... that's correct. Try
> with the complete xhtml here: <snip>
Makes sense. Furthermore, the reason for the colors missing on IE Mac 5.2.2
is now quite clear. The absence of text in the left and right <DIV> causes
IE Mac to drop the background color altogether, which is not correct
behavior.
So, I believe that IE Win 6.0 is, in fact, doing the right thing, while IE
Mac 5.2.2 is not.
Paul
IE Mac is probabably displaying the right colors, but the height for divs is set
to 0px if empty.
> So, I believe that IE Win 6.0 is, in fact, doing the right thing, while IE
> Mac 5.2.2 is not.
Mh... not so sure... there is a difference in handling white space/empty
elements.
This time I think IE6 is wrong (this is a known bug): for empty elements IE6
always set the height to "line-height", as if there is text in it.
And playing with it I found a strange behaviour: if you set "line-height:1px;"
in the body empty elements are not affected. Trying to set both "height:1px;"
and "line-height:1px;" doesn't work if the layer is empty. As soon as you put a
character in the div the height is displayed correctly.
Definitively a IE6 bug. IE5 mac is doing right
> Paul
fabrizio
PS. thanks for testing! A screenshot is better than lots of words
Well, IE5 Mac does something bizarre. Take another look at the screenshots
http://skycoast.us/fabrizio/
and pay special attention to the scroll bars. Very annoying.
Paul
unfortunately I don't have a mac so I can't test :-/
I rememeber hearing something like this... try setting the right position of the
right column to 1px instead of 0, some browsers display the scroll bar if you
position something to the extreme right of the window...
if this doesn't work it means that IE mac always leave space for the vertical
scroll bar, so the correct css for it should be "right:20px"... CSS
specifications don't say if browsers should render the scroll bar area and what
they have do to when a scrollbar appear...
fabrizio