Hi:
I have a CSS file. All my pages of the web site are based on this style sheet.
I've the following question:
(1) Do I need to make any change in the following statement so that it works correctly with MSIE? When I post this file inside Visual Studio .NET IDE, the IDE mark this statment as incorrect at "size: 2px" but I check the syntax and it seems to be OK
hr { size: 2px; color: #930; width: 100%; }
(2) What I need to change inside this statment (the same thing: Visual Studio mark this as incorrect)
background-image:url('norm
_left_on.g
if');
(3) This is really weird: inside this CSS file, there exist some typos on "postion" - I just found out inside this section of code:
#hnbctner {
postion: absolute;
top: 108px;
left: 144px;
width: 100%;
height: 34px;
margin: 0;
background:#DAE0D2 url('bg.gif') repeat-x bottom;; padding-left:144px; padding-right:0; padding-top:108px; padding-bottom:0
}
The strange thing is that when I correct this typo, the elements embedded inside this element are not displayed correctly any more.
I don't know what happened?
If you've some idea about these questions, please help.
I post all the code below.
Thanks a lot,
somits
I used the CSS file along with a User Control (ASP.NET) file --> somitsLayout.ascx
and a Web Form file --> WebForm1.aspx
The USER CONTROL (somitsLayout) is used to create the base layout for every page of my web site (create the banner, the navigate menu on the left, etc.
//------------------- CSS file
.basicPageStyle { margin: 0px; padding: 0px; width: 100%; height: 100%}
.basicBodyStyle { color: black; font-family: Helvetica, Arial, Verdana, sans-serif; background-color: #fff; margin: 0px; padding: 0px; width: 100%; height: 100%}
h1 { font-size: 200%; letter-spacing: 2px; margin: 0px; padding: 0px 0px 0px 24px }
h2 { font-size: 140%; color: #930; }
hr { size: 2px; color: #930; width: 100%; }
#hdbanner { color: #fff; background-color: #03f; position: absolute; top: 0px; left: 0px; width: 100%; height: 108px }
#lftnav { color: #000; font-size: 100%; font-family: "Times New Roman", times; background-color: #cff; margin: 0px; padding: 40px 0px 0px; position: absolute; top: 108px; left: 0px; width: 144px; height: 100% }
#lftnav a {display: block; margin: 0px; padding: 8px 0px 2px 10px; text-decoration: none;}
#lftnav a:hover { color: #900; background-color: #cc9; border-right: 2px solid #930; }
#hnbctner {
postion: absolute;
top: 108px;
left: 144px;
width: 100%;
height: 34px;
margin: 0;
background:#DAE0D2 url('bg.gif') repeat-x bottom;; padding-left:144px; padding-right:0; padding-top:108px; padding-bottom:0
}
div#hnbctner #hrznavbar {
float: left;
width: 864px;
margin: 0;
font-size: 75%;
font-family: times;
line-height: normal;; repeat-x; padding-left:bg.gif; padding-right:background; padding-top:0; padding-bottom:#DAE0D2
}
#hnbctner #hrznavbar ul {
margin: 0;
padding: 10px 10px 29px;
list-style: none;
}
#hnbctner #hrznavbar li {
float: left;
background:url('norm_left.
gif') no-repeat left top;
margin: 0;
padding-left:9px; padding-right:0; padding-top:0; padding-bottom:0
}
#hnbctner #hrznavbar a, #hnbctner #hrznavbar strong, #hnbctner #hrznavbar span {
display: block;
background:url('norm_right
.gif') no-repeat right top;
text-decoration: none; padding-left:6px; padding-right:15px; padding-top:5px; padding-bottom:4px
}
#hnbctner #hrznavbar #current {
background-image:url('norm
_left_on.g
if');
}
#hnbctner #hrznavbar #current a {
background-image:url('norm
_right_on.
gif');
padding-bottom: 5px
}
div#mncontent {
position: absolute;
top: 147px;
left: 144px;
width: 100%;
height: auto;
margin: 0;
padding: 16px 12px 0px 12px;
font-size: 75%;
font-family: times;
}
#mncontent a:hover {
color: #930;
background-color: #cc9;
}
#ftnote {
text-align: left;
}
div#underconstr {
margin: 0;
padding: 100px;
font-family: times;
font-size: 150%;
text-align: left;
color: blue;
}
//---------------- USER CONTROL file: somitsLayout.ascx
<%@ Control Language="c#" AutoEventWireup="false" Codebehind="pageBaseLayout
.ascx.cs" Inherits="TEST_ASPNET.page
BaseLayout
" TargetSchema="
http://schemas.microsoft.com/intellisense/ie5"%>
<DIV id="hdbanner">
<h1>
Here is a line of text of H1 Header
</h1>
<h2>
Here is another line of text of H2 Header
</h2>
</DIV>
<DIV id="lftnav">
<a href="WebForm1.aspx">Home<
/a>
<a href="underconst.aspx">Ser
vices</a>
</DIV>
<DIV id="hnbctner">
<DIV id="hrznavbar">
<ul>
<li>
<a href="computerlabs.aspx">C
omputer Labs</a>
</li>
<li>
<a href="helpdesk.aspx">Help Desk</a>
</li>
<li>
<a href="oams.aspx">Asset Management</a>
</li>
</ul>
</DIV>
</DIV>
//-------------------- WEB FORM file: WebForm1.aspx
<%@ Page language="c#" Codebehind="WebForm1.aspx.
cs" AutoEventWireup="false" Inherits="TEST_ASPNET.WebF
orm1" %>
<%@ Register TagPrefix="uc1" TagName="somitsLayout" Src="somitsLayout.ascx" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>WebForm1</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScri
pt" content="JavaScript">
<meta name="vs_targetSchema" content="
http://schemas.microsoft.com/intellisense/ie5">
<link href="basestyle.css" rel="stylesheet" type="text/css" media="screen">
</STYLE>
</HEAD>
<body MS_POSITIONING="GridLayout
">
<form id="Form1" method="post" runat="server">
<uc1:somitsLayout id="SomitsLayout1" runat="server"></uc1:somit
sLayout>
</form>
</body>
</HTML>