Solved

Extending Sidebar with CSS

Posted on 2007-11-25
4
1,109 Views
Last Modified: 2010-08-05
I have a page with a wrapper div.  In the wrapper I have a sidebar div for the left side navigation and a main div for the content.  I am can not figure out how to make the side bar  stay even in length with the main page.  Right now the sidebar is floating next to the  main div.

Things I have tried;
placed the main div inside the sidebar div
set sidebar height to 100% - thought I could extend it to height of the wrapper div.

Any suggestions or code improvements would be appreciated.


#main {
		float:right;
		background:#272727;
		margin:0 auto;
		width:671px;
		border: Solid 1px red;
	
	}
	
	#main H1
	{
    display: block;
	font-family: verdana;
	font-size: 20px;
	color: #fff;
	 }
 
	#sidebar {
	height: 514px;
	width:174px;
	background: black;
	background-image: url(images/leftnavguitar.JPG);
	background-repeat: no-repeat;
	background-position: 0% 100%;
	margin: 0px;
	Padding: 0px;
	border: Solid 1px yellow;
	}
 
 
 
 
 
#sidebar ul
{
list-style-type: none;
padding: 0px;
margin: 0px;
border: Solid 1px green;
}
 
#sidebar li
{
background-image: url(images/nav_arrow.gif);
background-repeat: no-repeat;
 
background-position: 1% 50%;
margin: 3px 0px 3px 0px;
padding: 0px 0px 0px 14px;
font-family: verdana;
font-size: .75em;
border: Solid 1px yellow;
}
 
 
#sidebar li A:link{text-decoration: none; color:#fff;}
#sidebar li A:hover {text-decoration: underline; color: #E7B33B;}

Open in new window

0
Comment
Question by:svp28
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 19

Expert Comment

by:LordOfPorts
ID: 20346739
I would recommend setting the height attribute of the parent element, wrapper div in this case, to 100%. Here is a simple example:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 
<html>
<head>
<title>Untitled</title>
 
<style type="text/css">
#divWrapper, #divSideBar, #divMain {
    height:100%;
    border:1px solid red;
}
 
#divSideBar {
    width:20%;
    float:left;
}
</style>
 
</head>
 
<body>
 
<div id="divWrapper">
 
<div id="divSideBar">
	 Side Bar
</div>
 
<div id="divMain">
	 Navigation
</div>
 
</div>
 
</body>
</html>

Open in new window

0
 

Author Comment

by:svp28
ID: 20393713
The following work

      #Container {
      border: solid 3px blue;
      overflow: auto;
      width: 100%
      height: 100%;
      }

please close this question as I soved the question myself.
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 20561739
PAQed with points refunded (50)

Computer101
EE Admin
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Error handling in PHP 5 82
WEB Farm 6 79
Edit a page at wix.com 8 81
Application.cfc - what is the order of events? 4 63
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Introduction A frequently used term in Object-Oriented design is "SOLID" which is a mnemonic acronym that covers five principles of OO design.  These principles do not stand alone; there is interplay among them.  And they are not laws, merely princ…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
This video teaches users how to migrate an existing Wordpress website to a new domain.

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question