Jump to content

height


notclive

Recommended Posts

I have a navbar on the left side of my site, and i want it to be as long as the whole site. In my css page i have this code

p.navbar	{text-align:'center';position: 'absolute';    	top: '0px';	left: '0px';	width: '175px';	height: '100%';	background:'#adc3f5'}

but this only makes my navbar the height of the screen, i thought 100% would make the bar as tall as the site, how can i get the navbar's height to adjsut to the height of any page?p.s. should this be in the css area sorry if it should.

Link to comment
Share on other sites

If you put a container div around your nav div and content div, then the container is the same height as the content div and the left nav div will then be 100% of the container div. :)

Link to comment
Share on other sites

ok here is what I use. no matter which column is longer, the other will lengthen to the same size:

#container{height:100; overflow:visible;}#col1{height:100%; overflow:visible;}#col2{height:100%; overflow:visible;}

of course, you must set the div's ids to those, or change them in the CSS. this still uses a container div (as you can probably see).LG

Link to comment
Share on other sites

that makes it so that whatever element has an id that matches the following text, the styles in that section will apply to them.you can change it to a . (apostraphy) if you want to use a class instead.LG

Link to comment
Share on other sites

change it to a . (apostraphy) if you want to use a class instead.
That's a period, btw. Apostrophe is 'For the divs, if you want to use the IDs, you do it like this:
#container {  ...}#col1 {  ...}etc<div id="container">  <div id="col1"></div>  <div id="col2"></div></div>

If you want to use classes instead:

.container {  ...}.col1 {  ...}etc<div class="container">  <div class="col1"></div>  <div class="col2"></div></div>

Link to comment
Share on other sites

cant get it to work maybe you could explain in more detail, im a newb at these things. Sorry  :)

Let us see what you got so far so we can see where your going wrong. :)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...