Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > CSS Help on making Div BGcolor across entire page when scroll bar appears

Reply
Thread Tools

CSS Help on making Div BGcolor across entire page when scroll bar appears

 
 
davidr@sharpesoft.com
Guest
Posts: n/a
 
      08-04-2006
Hi,

I am using Divs with CSS to setup a layout for a site. I am using the
<Div>s and style sheets below. I want the TopMenu to go across the
entire top of the browser. It does go across the entire top, but let
say my screen resolution is 800x600 and the "Content" Div forces scroll
bars for the user to scroll to the right to see an object then the
TopMenu doesn't go all the way across. The top menu will only go to
the screen resolution, but as soon as I scroll right and go over 600
pixels the color gets cut off. If I specify the width: 100%; or leave
it alone it does the same thing. If I set my screen resolution to 1024
x 768 the Top Menu goes across the entire top perfectly. Since there
is no scroll bar it won't be a problem.
My last question is for the leftPanel how can I make the bgcolor travel
all the way down 100% the height of the browser at all times with a
width of 155px? I have tried setting its height to 100% and that
doesn't work. If I set it to some real high # to like Height: 1000px
it does go all the way down, but I want it to be universial to were it
flows with the height of the browser and if a height scroll bars
appears it will travel down with it to however far it needs to go.

thanks,

David

<form id="form1" runat="server">
<div id="MainDiv">
<div id="TopMenu">
</div>
<div id="LeftPanel">
</div>
<div id="Content">
<IN HERE SOME CONTROL THAT IS MORE THAN 600 PIXELS>
</div>
<div id="rightContent">
</div>

</div>
</form>

CSS Files:


ody
{
margin: 0px;
}

#MainDiv
{

}
#TopMenu
{
height: 20px;
background-color: #a7cfe8;
}

#LeftPanel
{
background-color: #a7cfe8;
position: absolute;
width: 155px;
height: 100%;
top: 20px;
left: 0px;
}

#Content
{
margin-left: 156px;
padding-left: 10px;
padding-top: 10px;
}

#rightContent
{
position: absolute;
right: 0px;
top: 20px;
width: 5px;
}

 
Reply With Quote
 
 
 
 
bruce barker \(sqlwork.com\)
Guest
Posts: n/a
 
      08-04-2006
using height=100%, require that the object be inside some content with an
absolute heigth specified. in your case its ignored, and the height is the
content height. you aslo do not set the widths of the content divs, so they
are the size of their content.

you could use client script to set all the sizes correct.

-- bruce (sqlwork.com)


<> wrote in message
news: oups.com...
> Hi,
>
> I am using Divs with CSS to setup a layout for a site. I am using the
> <Div>s and style sheets below. I want the TopMenu to go across the
> entire top of the browser. It does go across the entire top, but let
> say my screen resolution is 800x600 and the "Content" Div forces scroll
> bars for the user to scroll to the right to see an object then the
> TopMenu doesn't go all the way across. The top menu will only go to
> the screen resolution, but as soon as I scroll right and go over 600
> pixels the color gets cut off. If I specify the width: 100%; or leave
> it alone it does the same thing. If I set my screen resolution to 1024
> x 768 the Top Menu goes across the entire top perfectly. Since there
> is no scroll bar it won't be a problem.
> My last question is for the leftPanel how can I make the bgcolor travel
> all the way down 100% the height of the browser at all times with a
> width of 155px? I have tried setting its height to 100% and that
> doesn't work. If I set it to some real high # to like Height: 1000px
> it does go all the way down, but I want it to be universial to were it
> flows with the height of the browser and if a height scroll bars
> appears it will travel down with it to however far it needs to go.
>
> thanks,
>
> David
>
> <form id="form1" runat="server">
> <div id="MainDiv">
> <div id="TopMenu">
> </div>
> <div id="LeftPanel">
> </div>
> <div id="Content">
> <IN HERE SOME CONTROL THAT IS MORE THAN 600 PIXELS>
> </div>
> <div id="rightContent">
> </div>
>
> </div>
> </form>
>
> CSS Files:
>
>
> ody
> {
> margin: 0px;
> }
>
> #MainDiv
> {
>
> }
> #TopMenu
> {
> height: 20px;
> background-color: #a7cfe8;
> }
>
> #LeftPanel
> {
> background-color: #a7cfe8;
> position: absolute;
> width: 155px;
> height: 100%;
> top: 20px;
> left: 0px;
> }
>
> #Content
> {
> margin-left: 156px;
> padding-left: 10px;
> padding-top: 10px;
> }
>
> #rightContent
> {
> position: absolute;
> right: 0px;
> top: 20px;
> width: 5px;
> }
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
making a scroll bar isaac2004 Javascript 6 02-28-2007 02:54 PM
Using a div with scroll bars - can we get the scroll bars on the left instead of the right side? UJ ASP .Net 1 11-01-2006 09:32 PM
How to do for a web page which have header(top), content (datagrid) with scroll bar, footer(bottom) using HTML's DIV Tag under ASP.NET? abc ASP .Net 1 04-30-2006 12:10 PM
Open in Title-Bar-Scroll-Bar-Only Window? George ASP .Net 4 02-13-2004 09:29 AM
horizontal scrollbar in a div causing another scroll bar to more. Jeremy Chapman ASP .Net 1 08-15-2003 10:01 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57