Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-21-2013, 12:31 AM   PM User | #1
rjpeek25
New to the CF scene

 
Join Date: Jan 2013
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
rjpeek25 is an unknown quantity at this point
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>
rjpeek25 is offline   Reply With Quote
Old 02-21-2013, 01:13 AM   PM User | #2
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
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
Excavator is offline   Reply With Quote
Old 02-21-2013, 03:00 AM   PM User | #3
rjpeek25
New to the CF scene

 
Join Date: Jan 2013
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
rjpeek25 is an unknown quantity at this point
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
Click image for larger version

Name:	Screenshot from 2013-02-20 20:54:28.jpg
Views:	4
Size:	44.5 KB
ID:	11941   Click image for larger version

Name:	Screenshot from 2013-02-20 20:56:18.jpg
Views:	4
Size:	48.4 KB
ID:	11942  
rjpeek25 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:47 PM.


Advertisement
Log in to turn off these ads.