Click here to Skip to main content
15,917,652 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
height and width is in percentage even problem comming with mozila and opera
please have a look of my code
..............................................................................

ASP.NET
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="LayoutPage.master.cs" Inherits="Pages_LayoutPage" %>

<!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>LayOutPage</title>
	 <script type="text/javascript" src="../JS/mi_resize.js"></script>
	 
		


 <style type="text/css">
		.tdstyle
		{
			height: 20px; 
			background-color: Silver; 
			font-family:Arial;
			font-size: 12px;
			font-weight:100;
		 }
		
		 .textBox
		 {  background-color: Silver; 
		 	height: 20px; 
			
		 	}
		.style2
		{
			width: 80%;
			height: 91%;
		}
	 .style5
	 {
		 width: 18%;
	 }
	</style>
  </head>
<body id="bdy" style="margin-bottom: 16px; margin-top: 0px; margin-left: 0px; margin-right: 0px; margin-bottom: 0px; height: 100%">
    <form id="form1" style="height: 100%" method="post" runat="server">
  
        
   <table id="tb" style="height: 100%; width: 100%" border="0" cellspacing="0">
				<tr>
					<td class="style5">
						<asp:Image ID="Image1" runat="server" 
							ImageUrl="~/Resources/logo_markemimaje.gif" style="margin-left: 10px; margin-top: 10px" 
							 Height="64px" Width="200px"/>
							</td>
							<td>     </td>
						  <td align="center"> 
							  <asp:ImageButton ID="ImageButton1" runat="server" Height="16px" 
								  ImageUrl="~/Resources/gotohome.bmp" Width="61px" onclick="ImageButton1_Click" />
					</td>
				</tr>
				
				<tr>
				   
					<td style="font-family:Arial; font-size: 13px">
						valign="top" class="style5" bgcolor="#CCCCCC">
						<hr width="90%" color="black" />
					    <br /><br />
						<div> <h5> Printer Model - 70X1</h5></div>
					  
						<asp:TreeView ID="TreeView1" runat="server" Height="100%" 
							onselectednodechanged="TreeView1_SelectedNodeChanged" style="margin-top: 0px" Width="95%" 
							ForeColor="Black">
							<hovernodestyle font-underline="True" />
							<nodes>
								<asp:TreeNode Text="Printer" 
									Value="Printer">
									
									<asp:TreeNode Text="Head Settings" Value="Head Settings"
									NavigateUrl="~/Pages/HeadSettings.aspx">
									<asp:TreeNode Text="Advanced Settings" Value="Advanced Settings"
									 NavigateUrl="~/Pages/AdvancedSettings.aspx">
									<asp:TreeNode Text="Line Settings" Value="Line Settings"
									NavigateUrl="~/Pages/LineSetting.aspx">
								
								
								<asp:TreeNode Text="Communication" Value="Communication">
									<asp:TreeNode Text="Ethernet Settings" Value="Ethernet Settings"
									NavigateUrl="~/Pages/EthernetSettings.aspx">
									<asp:TreeNode Text="Ethernet Ports" Value="Ethernet Ports">
									<asp:TreeNode Text="COM Settings" Value="COM Settings"
									NavigateUrl="~/Pages/ComSettings.aspx">
								
								<asp:TreeNode Text="System" Value="System">
									
									<asp:TreeNode Text="System Information" Value="SysInfo" NavigateUrl="~/Pages/SysInfo.aspx">
									<asp:TreeNode Text="Version" Value="Version" NavigateUrl="~/Default.aspx">
									<asp:TreeNode Text="Security" Value="Security">
									<asp:TreeNode Text="Restart" Value="Restart">
								
							</nodes>
						
						
					</td>
				    <td>    </td>
					<td class="style2">
					<hr style="width:100%;" color="black" />
						<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
						
					</td>
					
				</tr>
			</table>
    </form>
</body>
</html>
Posted
Updated 13-Oct-11 4:02am
v3
Comments
Richard MacCutchan 13-Oct-11 11:16am    
Do you have a question, apart from "please look at my code"?
Geekian_senate 13-Oct-11 12:06pm    
I would suggest to use different CSS for each browser and version, if there is little room for making the same CSS compatible with all browsers.
By the way, you seem to have used height and width in many places in the code. Where and what exactly you are seeing as a probelm is not clear in the question.

1 solution

Fix ur 1st table with style width to a value, not to percentage.

setting width,height 100% --> browser assume it to the inside content which makes the width and height for 100%;

A starting div or table having width,height 100% and no having any content or tag are inside it then browser assumes height,width 0px;









Reply If u understood something ...........
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900