...

View Full Version : vertically expanding divs



mjb
11-23-2009, 07:15 PM
Hey everyone. Is it possible to vertically expand this text area. Here's the file. http://jlandbirk.googlepages.com/index_a.html

<!-- middle -->
<div id="middlediv" style="position: absolute; left: 174px; top: 87px; width: 638px; height: 314px; z-index: 6;">
<img src="middle.gif" name="middle" align="top" border="0" height="314" width="638">

</div>

Thanks for your time

j05hr
11-23-2009, 07:29 PM
Take the height: 314; away and it will automatically be as long as your text is.

Excavator
11-23-2009, 07:43 PM
Hello mjb,
You can remove the height; 305px; from #Placeholderdiv and see where your text is.
Removing the height from #middlediv isn't going to help you much because your absolutely positioned #bottomdiv isn't going to move.

You should be able to accomplish that layout without using absolute positioning.

As an alternative, have a look at this solution - http://nopeople.com/CSS/slider/index.html - view the source to see how that's done.

Excavator
11-23-2009, 07:56 PM
Here's your images used in a layout with no ap. The text box will expand in height to wrap as much as you put in it.
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
html, body {
font: 100.1% "Comic Sans MS";
background: #FC6;
}
* {
margin: 0;
padding: 0;
border: 0;
}
#top {
width: 638px;
height: 28px;
margin: 30px auto 0;
background: url(http://jlandbirk.googlepages.com/top.gif);
}
#container {
width: 638px;
margin: 0 auto;
background: url(http://jlandbirk.googlepages.com/middle.gif) repeat-y;
font-size: 0.8em;
}
#container p {margin: 0 20px;}
#bottom {
width: 638px;
height: 36px;
margin: 0 auto;
background: url(http://jlandbirk.googlepages.com/bottom.gif);
}
</style>
</head>
<body>
<div id="top"></div>
<div id="container">
<p>
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna
aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no
sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo
duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
</p>
<p>
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna
aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no
sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo
duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
</p>
<!--end container--></div>
<div id="bottom"></div>
</body>
</html>

mjb
11-23-2009, 08:47 PM
Thanks j05hr for your advice. i'll give that a try.

Excavator thank you for your code. you're quite the expert. I'll check out your link as well.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum