473,837 Members | 1,922 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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="rightConten t">
</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;
}

Aug 4 '06 #1
1 5674
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)
<da****@sharpes oft.comwrote in message
news:11******** **************@ b28g2000cwb.goo glegroups.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="rightConten t">
</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;
}

Aug 4 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4483
by: Tristan Miller | last post by:
Greetings. I have a two-column web layout, where the first column is just the regular body text with a "marign-right" of 16em, and the second column is an "absolute"-positioned div with a width of 16em. I would like to have a footer extending across the entire width of the page, at the very bottom of the page (i.e., after both columns end). How can I do this? There is no way of knowing in advance which of the two columns will be...
1
6230
by: Rune RunnestÝ | last post by:
Hi, I have made a small program that doesn't work quite the way it should. It is a guestbook for the web, where visitors can write back their greetings. The program consists of 3 files: - guestbook.jsp -> this is the form - writeToFile -> writing the captured data from the form to a file - readFromFile -> reading all the greetings to the file guestbook.jsp Here is the file Guestbook.jsp: ------------------------------ <!--...
5
1730
by: Corrine | last post by:
Given a backend on a network server and a frontend on a local computer, when is data pulled across the network? For example, does Rst.Recordcount pull data across the network? How about Rst.Findfirst? When a form or report opens, do they pull all the data in the recordsource across the network? Thank you for your help! Corrine
2
12363
by: Michael | last post by:
Need some help trying to read values from web controls - specifically *finding* the controls (like a drop down list) - that are added dynamically added within an asp:panel control. The page contains multiple panels within the form. The panels appear at different times - for our argument, let's say panel 1 appears first, users clicks a submit button and then panel 1 disappears and panel 2 appears, etc. When clicks on the submit button...
26
2530
by: meltedown | last post by:
I have 2 left floating divs on a page. Sometime the left side is larger, sometimes the right side is larger. I want the page to have a margin at the bottom of whichever div is the largest. If I put a bottom margin on one of the divs, it might not be the largest div, in which case the margin won't show up. If I put the margin on both divs, when the right floats below the left side in a small window, there is too much margin between the...
3
2357
by: laredotornado | last post by:
Hello, Is there any notation that would allow me to write a reference to an HTTPS page without specifying the entire url? For example, right now I have <a href="order_form.html">Order Here</a> I'd like the order form page to appear "https://mydomain.myhost.com/order_form.html" without writing the
2
1522
by: simbarashe | last post by:
Hie Could someone please help me I'm trying to make a back button and I'm trying not to make the button a submit button. The action or the redirection to another page is done using php and my code is as follows: <link href="css/jobSheet.css" rel="stylesheet" type="text/css" /> <?php session_start(); ?>
6
2535
by: frankenstein | last post by:
I've not seen any real sollutions to this yet. I found something similar on this forum but the posted sollutions didn't work. I would like to make a drag to scroll for my blog, using JS. So far I have written the following (for use in Firefox): document.onmousedown = function(){ var e = arguments||event; var x = e.pageX; var y = e.pageY;
7
2235
by: chardish | last post by:
Hello, Is it possible to make a div part of the "background"? In other words, I want it to always render if that part of the screen is showing, but not create scrollbars under any circumstances. Furthermore, I want it to obey the same positioning rules as a normal div. And (like a background image) I don't want the presence of this div to shift other elements over. Cheers,
0
9843
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
9682
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10570
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10626
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7001
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5670
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5849
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4474
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4041
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.