Good day
I have created a ASP.net website for IE9 using CSS3 and HTML5. It works for IE9, Firefox, Google Chrome and Safari.
I made some modifications in my stylesheet that it can work for IE8. When I tested the website in IE8 (changing screen resolution, zooming in and out etc) the main content moves over the header. The menu, main content and footer stays together when zooming in and out.
When I zoom out, the menu + main content moves over the header. When I zoom in, the menu + main content moves away from the header and leaves a white space between the header and menu.
I used some css3 coding in the stylesheet that is not ompatible with IE8.
Here is my css code
//stylesheet
html, body, #main{ height: 100%; margin: 0; padding: 0;}
#form1
{
height:100%;
margin:0;
}
#UpdatePanel1
{
height:100%;
margin:0;
}
#header
{
-moz-background-size: cover;
background-size: cover;
background-image:url(/Images/header.gif);
background-size:100% 100%;
background-repeat:no-repeat;
clear:both;
background-color:#585858;
position:absolute;
top:0;
left:0;
width:100%;
height:25%;
z-index:-1;
background-position:center;
}
#menu
{
background-color :#7C7C7C;
height:auto;
text-decoration : none;
margin:150px 0px 0px 0px;
padding:0px 40px 0px 40px;
width:100% auto;
border-bottom:3px solid #B1ABAB;
min-height: 2%;
bottom:-200px;
position:relative;
}
#main
{
margin-right:60px;
margin-left:60px;
margin-top:200px;
height:auto;
background-color: #ECECEC;
width :100% auto;
padding:40px 40px 0px 40px;
overflow:auto;
min-height:100%;
}
#footerbottom {
clear: both;
position: relative;
z-index: 0;
height: 3em;
margin-top: -3em;
background-color: #585858;
border-top:3px solid #B1ABAB;
overflow:hidden;
}
#main { padding-bottom: 4em; }
#contactus { padding-bottom: 20em; }
#applications { padding-bottom: 20em; }
//master page
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="site.master.cs" Inherits="site" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head runat="server">
<title>TsogoSafe</title>
<link href="Styles/main.css" rel="stylesheet" type="text/css" />
<asp:ContentPlaceHolder ID="HeadContent" runat="server">
</head>
<body>
<form id = "form1" runat="server" autocomplete="off">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
<ContentTemplate>
<div id = "header">
<h1><br /><br /><br /></h1>
</div>
<div id = "menu">
<a href = "Default.aspx"> Home</a><span class="style1"></span> |
<a href ="Applications.aspx">Applications</a><span class="style1"></span>
| <a href ="Contact.aspx">Contact Us</a></div>
<div id = "main">
<asp:ContentPlaceHolder ID="MainContent" runat="server">
</asp:ContentPlaceHolder>
</div>
<div id = "footerbottom"></div>
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
</html>
My problem is, that my menu with the main content and footer is not "sticking" to my header.
What am I doing wrong in my stylesheet?