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 12-10-2011, 12:55 PM   PM User | #1
apotd
New Coder

 
Join Date: Oct 2011
Posts: 75
Thanks: 1
Thanked 0 Times in 0 Posts
apotd is an unknown quantity at this point
Height of div.

I tried to make this simple layout:

http://i39.tinypic.com/e7ml4p.gif

Now I want the menu (nav) to be the same height as the two content divs (test). Is there any way to do this?

HTML:

Code:
<body>

<div id="container">

	<header>
		<h1>This is the header.</h1>
	</header>
	
	<nav>
		<h2>Menu</h2>
		<ul>
			<li><a href="link.html">Link 1</a></li>
			<li><a href="link.html">Link 2</a></li>
		</ul>
	</nav>
	
	<div id="test">
		<h2>This is a title.</h2>
		<p>test</p>
	</div>
	
	<div id="test">
		<h2>This is another title.</h2>
		<p>test</p>
	</div>
	
	<footer>
		<p><small>footer.</small></p>
	</footer>
	
</div>
CSS:

Code:
body{
	width: 700px;
	margin: 0;
	padding: 0;
	font-family: georgia;
	margin: 0 auto 0 auto;
}

header, nav, footer, #test{
	display: block; 
}

header{
	background: #cccccc;
	-moz-border-radius: 15px;
	border-radius: 15px;
}

nav{
	float: left;
	width: 17%;
	background: #cccccc;
	-moz-border-radius: 15px;
	border-radius: 15px;
	padding: 10px;
}

#test{
	float: right;
	width: 75%;
	background: #cccccc;
	-moz-border-radius: 15px;
	border-radius: 15px;
	padding: 10px;
	margin: 0 0 15px 0;
}

footer{
	clear: both;
	background: #cccccc;
	-moz-border-radius: 15px;
	border-radius: 15px;
}
apotd is offline   Reply With Quote
Old 12-10-2011, 02:14 PM   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 apotd,
The normal methods won't work with your rounded corners.
Here is a jQuery solution - http://nopeople.com/CSS%20tips/jQuer...mns/index.html
__________________
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 12-10-2011, 02:31 PM   PM User | #3
apotd
New Coder

 
Join Date: Oct 2011
Posts: 75
Thanks: 1
Thanked 0 Times in 0 Posts
apotd is an unknown quantity at this point
And if I'd remove the rounded corners, how would I do it in that case?
apotd is offline   Reply With Quote
Old 12-10-2011, 04:09 PM   PM User | #4
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
Quote:
Originally Posted by apotd View Post
And if I'd remove the rounded corners, how would I do it in that case?
You can do it with a background color or an image repeated on the y axis.
Look at my faux columns demo. You can google faux columns for a million more examples.

Here's another equal height columns method that works very well too.
__________________
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 12-12-2011, 07:01 PM   PM User | #5
apotd
New Coder

 
Join Date: Oct 2011
Posts: 75
Thanks: 1
Thanked 0 Times in 0 Posts
apotd is an unknown quantity at this point
Thank you, this works fine. I forgot how I should mark this question as resolved though, since I can't seem to edit my first post.
apotd 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:29 PM.


Advertisement
Log in to turn off these ads.