Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    mjb
    mjb is offline
    New Coder
    Join Date
    May 2006
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    vertically expanding divs

    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

  • #2
    Regular Coder
    Join Date
    Nov 2008
    Posts
    175
    Thanks
    4
    Thanked 6 Times in 6 Posts
    Take the height: 314; away and it will automatically be as long as your text is.

  • #3
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,667
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    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.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #4
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,667
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    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.
    Code:
    <!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>
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #5
    mjb
    mjb is offline
    New Coder
    Join Date
    May 2006
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •