NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page CSS DIV Height 100%

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 12-15-2005, 05:39 PM THREAD STARTER               #1 (permalink)
NamePros Regular
Join Date: Feb 2004
Location: Student @ UConn
Posts: 411
gamex has a spectacular aura aboutgamex has a spectacular aura about
 



CSS DIV Height 100%


EDIT: SOLVED

Hey everyone,

I know you probably get this a lot, and in fact, I can usually help most people when they have this problem, but now that I am trying this on my own, I cannot figure it out. I have searched all over and the suggestions I saw didnt work, maybe its the way I have my divs set up. I have a lot of divs nested, but that is the only way I can get it set the way I want.

Here is my code, Its a little sloppy only because I have been trying to fix this.

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Template</title>
<style type="text/css">
#container {
	width: 668px;
	border: 18px solid #5A5A5A;
	background-color: #E8E8E8;
}

body {
	height: 100%;
}

#main{
	height: 100%;
}

#mainleft {
	float: left;
	width: 510px;
	padding-left: 8px;
	padding-top: 5px;
	padding-bottom: 10px;
	background-color: #E8E8E8;
	background-image: url('images/left_border.jpg');
	background-position: left;
	background-repeat: repeat-y;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	color: #333333;
	font-size: 12px;
	height: 100%;
}

#mainright {
	float: right;
	width: 150px;
	padding-top: 5px;
	padding-bottom: 10px;
	background-color: #E8E8E8;
	background-image: url('images/right_border.jpg');
	background-position: right;
	background-repeat: repeat-y;
	height: 100%;
}
#subheaderright img {
	vertical-align: top;
}

#subheaderright {
	width: 326px;
	float: right;
	background-color: #E8E8E8;
	background-image: url('images/right_border.jpg');
	background-position: right;
	background-repeat: repeat-y;
}

#subheaderleft img {
	vertical-align: top;
}

#subheaderleft {
	width: 342px;
	float: left;
	background-color: #E8E8E8;
	background-image: url('images/left_border.jpg');
	background-position: left;
	background-repeat: repeat-y;
}

#banner {
	background-color: #B7DAE0;
	height: 60px;
	width: 468px;
	vertical-align: middle;
}

img {
	border: 0;
}

#footer {
	width: 668px;
	background-color: #C4C4C4;
	margin: 0;
	padding: 0;
	text-align: center;
}

p {
	text-indent: 7px;
}
</style>

<script language="javascript" type="text/javascript">
<!--
image1 = new Image();
image1.src = "home_omo.jpg";

image2 = new Image();
image2.src = "members_omo.jpg";

image3 = new Image();
image3.src = "join_omo.jpg";

image4 = new Image();
image4.src = "demo_omo.jpg";

image5 = new Image();
image5.src = "contact_omo.jpg";

image6 = new Image();
image6.src = "links_omo.jpg";
-->
</script>
</head>

<body>
<div id="container">
	<div><img src="images/header_c.jpg" /><img src="images/header_d.jpg" /><img src="images/header_e.jpg" /></div>
	<div><img src="images/spacer_a.jpg" /><a href="index.php" onmouseover="image1.src='images/home_omo.jpg'" onmouseout="image1.src='images/home.jpg'"><img src="images/home.jpg" name="image1" /></a><img src="images/spacer_b.jpg" /><a href="members.php" onmouseover="image2.src='images/members_omo.jpg'" onmouseout="image2.src='images/members.jpg'"><img src="images/members.jpg" name="image2" /></a><img src="images/spacer_c.jpg" /><a href="join.php" onmouseover="image3.src='images/join_omo.jpg'" onmouseout="image3.src='images/join.jpg'"><img src="images/join.jpg" name="image3" /></a><img src="images/subheader_a.jpg" /><img src="images/subheader_b.jpg" /><img src="images/subheader_c.jpg" /><a href="demo.php" onmouseover="image4.src='images/demo_omo.jpg'" onmouseout="image4.src='images/demo.jpg'"><img src="images/demo.jpg" name="image4" /></a><img src="images/spacer_d.jpg" /><a href="contact.php" onmouseover="image5.src='images/contact_omo.jpg'" onmouseout="image5.src='images/contact.jpg'"><img src="images/contact.jpg" name="image5" /></a><img src="images/spacer_e.jpg" /><a href="links.php" onmouseover="image6.src='images/links_omo.jpg'" onmouseout="image6.src='images/links.jpg'"><img src="images/links.jpg" name="image6" /></a><img src="images/spacer_f.jpg" /></div>
	<div id="subheaderleft"><img src="images/subheader_d.jpg" /><img src="images/subheader_e.jpg" /><img src="images/subheader_f.jpg" /></div>
	<div id="subheaderright"><img src="images/subheader_g.jpg" /><img src="images/subheader_h.jpg" /><img src="images/subheader_i.jpg" /></div>
	<div id="main">
		<div id="mainleft"><p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut enim justo, facilisis vitae, fermentum in, tristique vel, lacus. Nullam varius elementum quam. Nulla facilisi. Nam commodo interdum dolor. Etiam ultrices nisi vel purus. Sed est arcu, malesuada non, molestie quis, venenatis et, justo. Curabitur tincidunt eros eget velit. In orci arcu, dapibus at, tempus non, dictum ac, urna. Proin pellentesque ligula varius ipsum. Sed a neque.</p></div>
		<div id="mainright">test2</div>
	</div>
	<div id="footer"><img src="images/footer.jpg"/></div>
</div>
</body>
</html>
Edit: The problem I am having is with the mainleft and mainright divs. Both of those are nested in the main div.
????: NamePros.com http://www.namepros.com/programming/148465-css-div-height-100-a.html
????: NamePros.com http://www.namepros.com/showthread.php?t=148465

Thanks,
__________________
Joe
Last edited by gamex; 12-15-2005 at 09:22 PM. Reason: Solved
gamex is offline  
Old 12-15-2005, 06:04 PM   #2 (permalink)
 
BillyConnite's Avatar
Join Date: Jul 2005
Location: Coffs H, Australia
Posts: 3,456
BillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond repute
 


Wildlife Parkinson's Disease Parkinson's Disease
Thats very weird... I had a crack at it... I could get the border to behave nicely, but the table did not take up 100% of the page... Were you looking for the table to take up a full pages height, or just as big as the text is...?
BillyConnite is online now  
Old 12-15-2005, 06:13 PM THREAD STARTER               #3 (permalink)
NamePros Regular
Join Date: Feb 2004
Location: Student @ UConn
Posts: 411
gamex has a spectacular aura aboutgamex has a spectacular aura about
 



I attached a screenshot of the page, if you would prefer that I upload it, let me know.

The blue box represents the main div, while the two green boxes represent the mainright and mainleft div. If you look at the Left one, the border stops, because the div doesnt extend to the bottom of the page. I would like that to extend all the way to the bottom. The same thing happens if the right div extends past the left one, but I assume once a solution is figured out for this one, I can use that for the left side as well.
Attached Images
File Type: jpg site.JPG (49.7 KB, 6 views)
__________________
Joe
gamex is offline  
Old 12-15-2005, 09:21 PM THREAD STARTER               #4 (permalink)
NamePros Regular
Join Date: Feb 2004
Location: Student @ UConn
Posts: 411
gamex has a spectacular aura aboutgamex has a spectacular aura about
 



Alright, I got it. I ended up creating one large background for the main div, putting some margins in the smaller nested divs, and then it worked.
__________________
Joe
gamex is offline  
Old 12-15-2005, 09:55 PM   #5 (permalink)
 
BillyConnite's Avatar
Join Date: Jul 2005
Location: Coffs H, Australia
Posts: 3,456
BillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond repute
 


Wildlife Parkinson's Disease Parkinson's Disease
Originally Posted by gamex
Alright, I got it. I ended up creating one large background for the main div, putting some margins in the smaller nested divs, and then it worked.
Good to hear you got it working...
????: NamePros.com http://www.namepros.com/showthread.php?t=148465

What i did was created a table around all your divds with 100% height and a 0 border, worked ok if youd rather trying that.

Best of luck.
BillyConnite is online now  
Old 12-15-2005, 10:01 PM THREAD STARTER               #6 (permalink)
NamePros Regular
Join Date: Feb 2004
Location: Student @ UConn
Posts: 411
gamex has a spectacular aura aboutgamex has a spectacular aura about
 



Thanks for the help.

Rep added.
__________________
Joe
gamex is offline  
Old 12-16-2005, 04:41 AM   #7 (permalink)
 
BillyConnite's Avatar
Join Date: Jul 2005
Location: Coffs H, Australia
Posts: 3,456
BillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond repute
 


Wildlife Parkinson's Disease Parkinson's Disease
Originally Posted by gamex
Thanks for the help.
????: NamePros.com http://www.namepros.com/showthread.php?t=148465

Rep added.
No problem and thankyou, even though you did solve the problem yourself lol.
Good luck.
BillyConnite is online now  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Various CSS problems Daniel Exe Programming 1 11-22-2005 11:46 AM
div - stretch the nav to fit height of content TeviH Programming 3 08-31-2005 09:15 PM
CSS relative height. pulling my hair out here! mrmiyagi Web Design Discussion 6 05-24-2005 07:05 AM
div positioning + css + IE problem? countcobolt Programming 0 12-22-2004 07:55 AM
div height problem tot Programming 2 05-12-2004 07:50 AM

Liquid Web Smart Servers  
All times are GMT -7. The time now is 03:55 PM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger