Jump to content

This is my CSS for nav bar. Why wont it scroll?


johnsmith153

Recommended Posts

This does a decent nav bar, but when the browser window is smaller, or for whatever reason the text in the left panel is too much, it doesn't scroll. What do I need to change?

 


body{
  margin:0;
  padding:50px 0 0 300px;
  background:#ffffff;
}
div#header{
  position:absolute;
  z-index:1;
  top:0;
  left:300px;
  width:100%;
  height:50px;
  background:#cccccc;
  color: #000000;
}
div#left-sidebar{
  position:absolute;
  top:0;
  left:0;
  width:300px;
  background:#ffffff;
  color: #000000;
}
div#content{
  margin:0;
  padding:50px 0 0 300px;
  background:#ffffff;
}
  body>div#header{
   position:fixed;
  }
  body>div#left-sidebar{
   position:fixed;
  }
* html body{
  overflow:hidden;
}
* html div#content{
  height:100%;
  overflow:auto;
}
input {
background: #FFFFFF !important;
} 

Link to comment
Share on other sites

Thanks, but I have tried this.

 

There is definitely something wrong with the code.

 

if anyone has the time to quickly test it out.

 

Just put lots of text in these 3 divs

<div id="left-sidebar">

<div id="content">

<div id="header">

 

I can sort of get the left pane to show scrollbars - but they hardly move - still not showing the full text

Link to comment
Share on other sites

im not sure what your trying to get for content but absolute pos is bad for this..

 

 

are you making it like this

 

http://lawrenceguide.org/test.html

 

or are you wanting the

 

left nav |  header header header header header

left nav |  header header header header header

left nav |  header header header header header

left nav | -----------------------------------

left nav | ContentContentContentContentContent

left nav |ContentContentContentContent

left nav | ContentContentContentContent

left nav |ContentContentContentContent

 

Link to comment
Share on other sites

I would like it like:

left nav |  header header header header header

left nav |  header header header header header

left nav |  header header header header header

left nav | -----------------------------------

left nav | ContentContentContentContentContent

left nav |ContentContentContentContent

left nav | ContentContentContentContent

left nav |ContentContentContentContent

 

The left nav holds text/buttons etc so it fits perfectly for 1024x768 screen, so normally no probs, but if someone using 800x600 or the browser isnt fully open, then hopefully they would get the scrollber. At the moment, they just wont be able to see all the text - which is obviously not good.

 

Content to just scroll as now, which it does using the main browser scrollbar (not a scrollbar generated by css/html) - this is perfect.

 

Header not to move really (ie display an advertisement etc.) - this also works fine now.

 

Thanks.

Link to comment
Share on other sites

you should just use percentages then the nav will resize better  i added a container div to prevent the full screen then you set header and content to 70 percent and leftnav to 30 percent

Something like below should work alot better then what you were trying..

<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"><style>
body{
  margin:0;
  background:#ffffff;
}
div.contain {width:80%;margin:0 auto;}
div#header{width:70%;overflow:auto;height:50px;background:#cccccc;color: #000000;float:right;}
div#content {width:70%;float:right;overflow:auto;height:100%;
  background:#ffffff;}
div#left-sidebar {border:1px solid #f00;width:29%;float:left;overflow:auto;background:#ffffff;color: #000000;}

</style>
</head><body>
<div class="contain">
<div id="header"></div>
<div id="left-sidebar">this is the left side<br>

</div>
<div id="content"></div>
</div></body></html>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.