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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jan 2013
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Element's height expands to fill the viewport and below

    I would like to know if this effect can be done with a compliant html document (with a doctype) using divs. Element's height expands to fill the viewport when there is little content (no scroll bar) and expands below the viewport as the content grows (scroll bar). This can be demistrated using the following examples. Note these examples work without a doctype defined.


    table {
    width: 100%;
    height: 100%;
    border: 1px solid red;
    }


    <html>

    <head>
    <title>Example 1</title>
    <link rel="StyleSheet" href="example1.css" type="text/css">
    </head>

    <body>
    <table>
    <tr><td>
    Content Goes Here<br>
    </td></tr>
    </table>

    </html>



    <html>

    <head>
    <title>Example 2</title>
    <link rel="StyleSheet" href="example2.css" type="text/css">
    </head>

    <body>
    <table>
    <tr><td>
    Content Goes Here<br>
    Content Goes Here<br>
    Content Goes Here<br>
    Content Goes Here<br>
    Content Goes Here<br>
    Content Goes Here<br>
    Content Goes Here<br>
    etc..
    </td></tr>
    </table>

    </html>

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello rjpeek25,
    Look at this full height demo to see my preferred method.
    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

  • #3
    New to the CF scene
    Join Date
    Jan 2013
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I think your close, I messed around with your code but I could not get it to mold into what I'm wanting. Here are two screen shoots what I'm looking for. This bordered box look is what I'm after.
    Attached Thumbnails Attached Thumbnails Element's height expands to fill the viewport and below-screenshot-2013-02-20-20-54-28.jpg   Element's height expands to fill the viewport and below-screenshot-2013-02-20-20-56-18.jpg  


  •  

    Posting Permissions

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