dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: fixed and variable div heights

  1. #1
    Join Date
    Aug 2004
    Location
    Brighton,UK
    Posts
    96

    fixed and variable div heights

    i want a div to resize its height when the browser is resized but also want the div to be 100 pixels from the top and i want the bottom edge to be 40 pixels from the bottom. i know that you can define the hight as a percentage but this will not work in this case because the 100 and 40 are not percentages

  2. #2
    Join Date
    Jun 2003
    Location
    here
    Posts
    4,551
    <style>
    <!--
    .inmiddle{
    position: absolute;
    top: 100px;
    left: 50px;
    right: 50px;
    bottom: 50px;
    }
    -->
    </style>
    <div class=inmiddle>some content and stuff</div>


    if that doesn't work(which I doubt for IE) then you'll have to turn to Javascript...
    EDIT: I though I might try this:
    <div style="position: absolute; top: 0px; bottom: 0px; height: 100%; padding-top: 100px; padding-bottom: 50px;">
    <div>content</div>
    </div>
    Last edited by scragar; 03-16-2005 at 05:02 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles