SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot maileen's Avatar
    Join Date
    Apr 2006
    Posts
    158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question div resize itself according to child div

    Hi,

    i have a div A which includes a div B.
    div A has a background image which is repeating itself on y axis.
    The div B (child of div A) use the whole area of div A.
    if height of div B is changing, it should automatically resize div A height also.

    so, how can i display background-image of div A on its whole height and make it visible even if div B display some text.
    ==> i thought to use z-index (with overflow : auto) but it does not work :-(

    thanks a lot,

    M.

  2. #2
    Non-Member
    Join Date
    Jan 2005
    Location
    Netherlands
    Posts
    4,300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello

    ?
    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" xml:lang="en" lang="en">
    <head>
    <title>12345 12345 12345 12345 12345</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    	<!-- saved from url=(0022)http://www.domain.com/ -->
    	<style type="text/css">
    	.a{background:url(http://www.google.nl/images/firefox/fox1.gif) repeat-y;}
    	</style>
    	<script type="text/javascript">
    
    	</script>
    </head>
    <body>
    
    <div class="a">
    
    <div class="b">some <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> text</div>
    
    </div>
    
    </body>
    </html>


Bookmarks

Posting Permissions

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