Web Hosting Talk







View Full Version : Left-side Navigation Menu


sithpigeon
05-06-2009, 10:41 PM
Hello everyone I'm new here and have been taking a web design class in school that I enjoy a lot and joined the forums to learn more about it. All right, to my problem:

I have created a navigation menu <div> that sits on the left of the page using float: left; and contains all the links on my page. The content part of the page sits to the right of the menu until it gets to the end of the navigation div and then all the information spills underneath it and lines up with the left of the window. I've seen numerous pages where this doesn't happen and looked through their code to try and find the solution but I just don't see it.

bluesolutionsuk
05-07-2009, 02:22 PM
Have you got a sample of the site so we can take a look?

Should then be able to help you xP

raviG
05-07-2009, 04:54 PM
If you style the UL and Content Div with appropriate "width" and "float", it should work fine! :)

Any link to your site?

tim2718281
05-07-2009, 07:49 PM
I have created a navigation menu <div> that sits on the left of the page using float: left; and contains all the links on my page. The content part of the page sits to the right of the menu until it gets to the end of the navigation div and then all the information spills underneath it and lines up with the left of the window.

You need to set the height ofthe navigation div, and also ensure the content div does not exceed that height.

Try this (I've added another column on the right.)

<html>
<head>
<style type="text/css">
#MainBody{
position: relative;
height: 100%;
overflow: auto;
border-bottom: 1px solid #a6a590;
text-align: left;
}

#Navigation{
position: relative;
float: left;
width: 30%;
height: 100%;
left:0%
padding: 0px;
background-color: #f5f7f7;
font: small Verdana,sans-serif;
border-right: 1px solid #a6a590;
border-top: 1px solid #a6a590;
}

#Updates{
position: relative;
float: right;
right: 0%;
width: 20%;
height: 50%;
background-color: #f5f7f7;
font: small Verdana,sans-serif;
border-left: 1px solid #d6d5c0;
border-top: 1px solid #a6a590;
}
</style>

</head>
<body>

<div id="Navigation">
<h2>Navigation</h2>
<p>blah1 blah1 blah1 blah1 blah1 blah1 blah1 blah1 blah1</p>
</div>

<div id="Updates">
<h2>Updates</h2>
<p>blah3 blah3 blah3 blah3 blah3 blah3 blah3 blah3 blah3 blah3 blah3 blah3 blah3 blah3 blah3 blah3 blah3 blah3 blah3 blah3 blah3 blah3 blah3 blah3 blah3</p>
</div>

<div id="MainBody">
<h2>MainBody</h2>
<p>blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 blah2 </p>
</div>


</body>
</html>

siforek
05-07-2009, 08:10 PM
Or you could do it the quick, easy, and IMO right way..

Simply set a fixed width for the content div.

KmacK
05-07-2009, 11:22 PM
Have you looked at 960.gs

It will save you a ton of time and give you a solid frame work to start all of your sites with.

webberoo
05-09-2009, 10:10 PM
Have you looked at 960.gs

It will save you a ton of time and give you a solid frame work to start all of your sites with.

Got a link?

Replicada
05-10-2009, 07:37 AM
Or you could do it the quick, easy, and IMO right way..

Simply set a fixed width for the content div.

This gets my vote also.

KmacK
05-10-2009, 10:31 AM
Got a link?

Yes, http://960.gs

webberoo
05-10-2009, 01:47 PM
Yes, http://960.gs

Thanks checking it out today :agree:

s2mu3123
05-11-2009, 02:06 PM
If you style the UL and Content Div with appropriate "width" and "float", it should work fine!

And please can you provide url of your site so that i can help you out more.