473,403 Members | 2,183 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Height at 100% Not Working

I am trying to create some pages and have them take 100% of the window, but I
cannot get 100% to work. If I set the height of my div, the page displays a
scroll bar and it looks like I set the height to about 150%. I tried using
CSS, now I am trying tables. Can someone show me where I am mixing things up?
Thanks.

--Master Sheet
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="master.master.cs"
Inherits="pts" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Project Tracking System</title>
<script language="JavaScript" src="scripts/menu.js"
type="text/javascript"></script>
<script language="JavaScript" src="scripts/popup.js"
type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="pts.css">
</head>
<body>
<form id="frmMaster" runat="server">
<div id="main">
<div id="header"><a href="default.aspx" style=" font-size:x-large;
font-weight: bold; color: White;">Time Management System</a></div>
<div id="banner">
<a class="bannerlink" href="about:blank">Access Timecard</a>
<a class="bannerlink" href="about:blank">Enter New Employees</a>
<a class="bannerlink" href="SelectProject.aspx">Edit Time Data</a>
<a class="bannerlink" href="#" onclick="LoadContextMenu();">Reports</a>
</div>
<div id="divContainer" style="height: 100%;">
<asp:contentplaceholder id="cphMaster" runat="server">
</asp:contentplaceholder>
</div>
<div id="footer"></div>
</div>
</form>
</body>
</html>

--Main Page
<%@ Page Language="C#" MasterPageFile="~/master.master"
AutoEventWireup="true" CodeFile="ProjectOverviewTest.aspx.cs"
Inherits="ProjectOverview" Title="Time Management System" %>
<asp:Content ID="cntProjectOverview" ContentPlaceHolderID="cphMaster"
Runat="Server">
<div id=divProjectData style="text-align:center">
<div id="divTabsContainer" style="z-index:999; margin-top: 20px;
margin-bottom: -1px; text-align:left; width:95%; left: -1px;">
<asp:linkbutton id="lbOverview" runat="server" CssClass="activelink"
Height="20px" CausesValidation="False">Overview</asp:linkbutton>
<asp:linkbutton id="lbFinancial" runat="server" CssClass="inactivelink"
Height="20px" CausesValidation="False"
onclick="lbFinancial_Click">Financial</asp:linkbutton>
<asp:linkbutton id="lbSchedule" runat="server" CssClass="inactivelink"
Height="20px" CausesValidation="False"
onclick="lbSchedule_Click">Schedule</asp:linkbutton>
<asp:linkbutton id="lbContacts" runat="server" CssClass="inactivelink"
Height="20px" CausesValidation="False"
onclick="lbContacts_Click">Contacts</asp:linkbutton>
<asp:linkbutton id="lbPTO" runat="server" CssClass="inactivelink"
Height="20px" CausesValidation="False" onclick="lbPTO_Click">PRO
Earned</asp:linkbutton>
<asp:linkbutton id="lbEventSummary" runat="server"
CssClass="inactivelink" Height="20px" CausesValidation="False"
onclick="lbSummary_Click">Summary</asp:linkbutton>
</div>
<table id="content" style="BORDER: darkblue 1px solid; text-align:left;"
height="80%">
<tr>
<td>

</td>
</tr>
</table>
</div>
</asp:Content>

--CSS Page
body
{
font-family: Arial;
font-size: 9pt;
color: Navy;
margin: 0px;
padding: 0px;
}

div
{
position: relative;
}

#smallHeader
{
background: #c0c0c0 url(images/icons/background_main.jpg) repeat-x left top;
width: 100%;
height: 25px;
font-size:medium;
font-weight: bold;
color: White;
text-indent: 2px;
padding-top: 2px;
}

#header
{
background: #c0c0c0 url(images/icons/background_main.jpg) repeat-x left top;
width: 100%;
height: 50px;
font-size:x-large;
font-weight: bold;
color: White;
text-indent: 5px;
padding-top: 1%;
}

#banner
{
background-color: #666666;
border-bottom: solid 1px #222222;
border-top: solid 1px #222222;
height: 25px;
line-height: 23px;
font-size: 8pt;
font-weight: bold;
color: White;
}

a
{
text-decoration: none;
padding-left: 10px;
padding-right: 10px;
font-weight: bold;
font-size: 9pt;
z-index: 1;
height: 20px;
}

a.activelink
{
border:solid 1px blue;
border-bottom: solid 1px white;
cursor:default;
}

a.inactivelink
{
border:solid 1px blue;
background: silver;
}

a.inactivelink:hover
{
text-decoration: underline;
background: white;
}

#imgAdd
{
cursor: hand;
border-style: none;
margin-top: 1%;
}

..bannerlink
{
font-size: 9pt;
font-weight: bold;
padding-left: 20px;
padding-right: 20px;
padding-top: 2px;
padding-bottom: 2px;
text-decoration: none;
color: white;
}

..bannerlink:hover
{
background-color: gray;
color: White;
padding-top: 1px;
padding-bottom: 1px;
padding-left: 19px;
padding-right: 19px;
border: solid 1px #222222;
}

#content
{
height: 726px;
width: 95%;
}

#footer
{
background-color: #666666;
height: 25px;
line-height: 23px;
text-align: center;
font-size: 8pt;
font-weight: bold;
color: White;
text-indent: 50px;
}

#iframe
{
margin: 2%;
width: 95%;
background-color: White;
font-weight: normal;
color: Navy;
vertical-align: top;
height: 98%;
}

span.boldLabel
{
font-weight: bold;
color: Navy;
text-align:right;
}

label
{
color: Navy;
}

input
{
font-family: Arial;
font-size: 9pt;
color:Black;
}

select
{
font-family: Arial;
font-size: 9pt;
color: Navy;
}

option
{
font-family: Arial;
font-size: 9pt;
color: Navy;
}
Nov 21 '06 #1
1 6468
you are doing nothing wrong. xhtml does not support this.

the body does not have a default height, so a 100% height in the div has no
effect, its still the size of its content. for the 100% to work, the div
must be contained in an object with an absolute height. you need to use
javascript which calc's the screen size and sets the height of the div. use
the body onresize event to do this.

-- bruce (sqlwork.com)

"Mike Collins" <Mi*********@discussions.microsoft.comwrote in message
news:D3**********************************@microsof t.com...
>I am trying to create some pages and have them take 100% of the window, but
I
cannot get 100% to work. If I set the height of my div, the page displays
a
scroll bar and it looks like I set the height to about 150%. I tried using
CSS, now I am trying tables. Can someone show me where I am mixing things
up?
Thanks.

--Master Sheet
<%@ Master Language="C#" AutoEventWireup="true"
CodeFile="master.master.cs"
Inherits="pts" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Project Tracking System</title>
<script language="JavaScript" src="scripts/menu.js"
type="text/javascript"></script>
<script language="JavaScript" src="scripts/popup.js"
type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="pts.css">
</head>
<body>
<form id="frmMaster" runat="server">
<div id="main">
<div id="header"><a href="default.aspx" style=" font-size:x-large;
font-weight: bold; color: White;">Time Management System</a></div>
<div id="banner">
<a class="bannerlink" href="about:blank">Access Timecard</a>
<a class="bannerlink" href="about:blank">Enter New Employees</a>
<a class="bannerlink" href="SelectProject.aspx">Edit Time Data</a>
<a class="bannerlink" href="#"
onclick="LoadContextMenu();">Reports</a>
</div>
<div id="divContainer" style="height: 100%;">
<asp:contentplaceholder id="cphMaster" runat="server">
</asp:contentplaceholder>
</div>
<div id="footer"></div>
</div>
</form>
</body>
</html>

--Main Page
<%@ Page Language="C#" MasterPageFile="~/master.master"
AutoEventWireup="true" CodeFile="ProjectOverviewTest.aspx.cs"
Inherits="ProjectOverview" Title="Time Management System" %>
<asp:Content ID="cntProjectOverview" ContentPlaceHolderID="cphMaster"
Runat="Server">
<div id=divProjectData style="text-align:center">
<div id="divTabsContainer" style="z-index:999; margin-top: 20px;
margin-bottom: -1px; text-align:left; width:95%; left: -1px;">
<asp:linkbutton id="lbOverview" runat="server" CssClass="activelink"
Height="20px" CausesValidation="False">Overview</asp:linkbutton>
<asp:linkbutton id="lbFinancial" runat="server" CssClass="inactivelink"
Height="20px" CausesValidation="False"
onclick="lbFinancial_Click">Financial</asp:linkbutton>
<asp:linkbutton id="lbSchedule" runat="server" CssClass="inactivelink"
Height="20px" CausesValidation="False"
onclick="lbSchedule_Click">Schedule</asp:linkbutton>
<asp:linkbutton id="lbContacts" runat="server" CssClass="inactivelink"
Height="20px" CausesValidation="False"
onclick="lbContacts_Click">Contacts</asp:linkbutton>
<asp:linkbutton id="lbPTO" runat="server" CssClass="inactivelink"
Height="20px" CausesValidation="False" onclick="lbPTO_Click">PRO
Earned</asp:linkbutton>
<asp:linkbutton id="lbEventSummary" runat="server"
CssClass="inactivelink" Height="20px" CausesValidation="False"
onclick="lbSummary_Click">Summary</asp:linkbutton>
</div>
<table id="content" style="BORDER: darkblue 1px solid; text-align:left;"
height="80%">
<tr>
<td>

</td>
</tr>
</table>
</div>
</asp:Content>

--CSS Page
body
{
font-family: Arial;
font-size: 9pt;
color: Navy;
margin: 0px;
padding: 0px;
}

div
{
position: relative;
}

#smallHeader
{
background: #c0c0c0 url(images/icons/background_main.jpg) repeat-x left
top;
width: 100%;
height: 25px;
font-size:medium;
font-weight: bold;
color: White;
text-indent: 2px;
padding-top: 2px;
}

#header
{
background: #c0c0c0 url(images/icons/background_main.jpg) repeat-x left
top;
width: 100%;
height: 50px;
font-size:x-large;
font-weight: bold;
color: White;
text-indent: 5px;
padding-top: 1%;
}

#banner
{
background-color: #666666;
border-bottom: solid 1px #222222;
border-top: solid 1px #222222;
height: 25px;
line-height: 23px;
font-size: 8pt;
font-weight: bold;
color: White;
}

a
{
text-decoration: none;
padding-left: 10px;
padding-right: 10px;
font-weight: bold;
font-size: 9pt;
z-index: 1;
height: 20px;
}

a.activelink
{
border:solid 1px blue;
border-bottom: solid 1px white;
cursor:default;
}

a.inactivelink
{
border:solid 1px blue;
background: silver;
}

a.inactivelink:hover
{
text-decoration: underline;
background: white;
}

#imgAdd
{
cursor: hand;
border-style: none;
margin-top: 1%;
}

.bannerlink
{
font-size: 9pt;
font-weight: bold;
padding-left: 20px;
padding-right: 20px;
padding-top: 2px;
padding-bottom: 2px;
text-decoration: none;
color: white;
}

.bannerlink:hover
{
background-color: gray;
color: White;
padding-top: 1px;
padding-bottom: 1px;
padding-left: 19px;
padding-right: 19px;
border: solid 1px #222222;
}

#content
{
height: 726px;
width: 95%;
}

#footer
{
background-color: #666666;
height: 25px;
line-height: 23px;
text-align: center;
font-size: 8pt;
font-weight: bold;
color: White;
text-indent: 50px;
}

#iframe
{
margin: 2%;
width: 95%;
background-color: White;
font-weight: normal;
color: Navy;
vertical-align: top;
height: 98%;
}

span.boldLabel
{
font-weight: bold;
color: Navy;
text-align:right;
}

label
{
color: Navy;
}

input
{
font-family: Arial;
font-size: 9pt;
color:Black;
}

select
{
font-family: Arial;
font-size: 9pt;
color: Navy;
}

option
{
font-family: Arial;
font-size: 9pt;
color: Navy;
}

Nov 21 '06 #2

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

Similar topics

5
by: Duane Lambe | last post by:
On some suggestions from this group, I've started to turn my internal helpdesky site for our company to non-absolute positioning. I've been reading O'Reilly's CSS book, and several web sites and...
1
by: Ron Bott | last post by:
I have a layout that has a fixed size #container <div> with a shadow running along the right side that encloses the content area. I would like the shadow background to extend to the full height of...
3
by: Raghavendra | last post by:
Hi All, Here is my code. ------------------------------------------- <div style="height:100%"> <BODY> sample text spanning about 30 lines </BODY> </div>...
6
by: jslaybaugh | last post by:
I'm working on an ASP.NET 2.0 application and am having trouble with a very simple table layout. Using ASP.NET 2.0 it defaults to XHTML 1.0 Transitional and I am trying to comply. However, I...
4
by: hans.kindberg | last post by:
This is how my page looks like in IE6: http://www.freewebs.com/hasodaki/default.txt (without advertising banner, browsable with IE6 and to see the code with the other browsers)...
14
by: rsearing | last post by:
I am new to HTML and will have to beg if this is obvious, but I am trying to design a table that looks like: ******************************** *----A------*------------------------*...
0
by: sunny10 | last post by:
Hello, I am new in asp.net and working on my first web application. I am using wizards and want to set its height in percentage let say 100%, but its not working, each wizard step shows different...
4
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I am using a I frame in a page and trying to set the height to height=100% and it is not working. If I use height=600px it works. I find some stuff about the DOCTYPE on the internet but changing...
7
by: ad08 | last post by:
I want to create a div over the body which should take 100% height of the page. I am defining html and body height is 100%. Also the div height is 100%. still it's not working for me. Can some one...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.