PDA

View Full Version : CSS Frames problems with IE



dreadedman
11-13-2008, 04:21 AM
1) Script Title:
CSS Left and Top Frames Layout
2) Script URL (on DD):
http://www.dynamicdrive.com/style/layouts/item/css-left-and-top-frames-layout/
3) Describe problem:

I have used something like this script to create a css frame layout, but with an extra footer.
It works correctly on everything except for IE 6+, where the padding value for the left (126 in this case) also makes IE render the padding on the right with the same value.
* html body{ /*IE6 hack*/
padding: 93px 0 13px 126px;
}

Here is my html:


<!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" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>TESTING</title>
<link href="main_style.css" rel="stylesheet" type="text/css" />
<!--[if IE 7]>
<link rel="stylesheet" href="main_style_ie7.css" type="text/css">
<![endif]-->
<!--[if IE 6]>
<link rel="stylesheet" href="main_style_ie6.css" type="text/css">
<![endif]-->


</head>
<body >
<!-- TOP NAV -->
<div id="framecontentTop">TOP FRAME</div>

<!-- SIDE NAV -->
<div id="framecontentLeft">LEFT FRAME</div>

<!-- MAIN CONTENT -->
<div id="contentArea" style="top:83px;">MAIN Content.The top margin is set by SSI.</div>

<!-- FOOTER -->
<div id="footer">Footer</div>

</body>
</html>

I have a css file for most, then an extra one for the ie fixes that only ie sees and uses. Here's the general one:


/*
WORK iT ONLINE Version 2.0 Members CSS
Created by Rhys Stephens 31st October 2008
Copyright WORK iT Services Pty Ltd, Australia

*/
html {
overflow:hidden;
}

body{
margin: 0;
padding: 0;
border: 0;
overflow: hidden;
height: 100%;
max-height: 100%;
font-family:Verdana, Arial, Helvetica, sans-serif;
}
#framecontentLeft {
position: fixed;
top: 83px;
left: 0px;
width: 126px; /*Width of left frame div*/
height: 100%;
overflow: hidden; /*Disable scrollbars. Set to "scroll" to enable*/
background-color: #3C3B3B;
margin:0;
padding:0;
background-image:url(../../images/sub_nav_bg.jpg);
background-repeat:repeat-x;
background-position:top;
}
#framecontentTop {
position: fixed;
left: 0px;
right: 0px;
width: auto;
top: 0px;
height: 83px;
overflow: hidden;
background-image:url(../../images/spacer.jpg);
background-position:bottom;
background-repeat:repeat-x;
margin:0;
padding:0;
}
#framecontentFilter {
position:fixed;
left:126px;
right:0px;
top:83px;
background-color:#3C3B3B;
width:auto;
overflow:visible;
z-index:10;
font-size:0.6em;
margin:0;
}
#contentArea {
position:fixed;
left: 126px;
bottom: 15px;
right:0;
overflow:auto;
}
#footer {
position:absolute;
left:0;
bottom:0px;
overflow:hidden;
background-color:#3C3B3B;
color:#FFFFFF;
width:100%;
font-size:0.6em;
text-align:right;
height:15px;
margin:0 auto;
}

p {
margin-top:0px;
}
dt {
font-size:1em;
color:#C50C09;
font-weight:bold;
}
dd{
margin-left:25px;
margin-bottom:20px;
}
dl {
margin-left:20px;
}
a {
text-decoration:none;
color:#C50C09;
}
a:hover {
text-decoration:underline;
}
ul {
margin:0;
}

/* The main content sizes */
#contentArea {
font-size:8pt;
}
.innertube {
margin: 15px;
}
.heading {
margin:15px;
color:#C50C09;
font-size:1.3em;
font-weight:bold;
}
.subheading {
color:#C50C09;
font-size:1.1em;
font-weight:bold;
}
/* END */
#nav {
float:right;
}
form,table {
margin:0;
padding:0;
}
#logo {
float:left;
}
/* MAIN NAV */
ul#menu {
background-image:url(../../images/nav_left.jpg);
background-repeat:repeat-x;
background-position:left top;
position:relative;
top:40px;
bottom:0px;
padding:0;
padding-left:3px;
margin:0;
list-style-type:none;
display:table;
right:100px;
text-align:center;
}
ul#menu li {
display:table-cell;
height:43px;
width:106px;
padding:0px;
margin:0px;
text-align:center;
}
ul#menu a {
color:#FFFFFF;
margin: 0px;
padding:0px;
padding-top:12px;
height:43px;
width:106px;
background-image:url(../../images/nav_up.jpg);
background-repeat:no-repeat;
display:inline-block;
font-size:0.8em;
text-decoration:none;
}
ul#menu a:hover {
color:#C50C09;
}
ul#menu a.active{
color:#FFFFFF;
background-image:url(../../images/nav_down.jpg);
cursor:default;
}

/* SECOND LEVEL MENU */
ul#subMenu {
margin-left:5px;
margin-top:5px;
padding:0;
list-style-type:none;
}
ul#subMenu a {
color:#FFFFFF;
margin: 0px;
height:21px;
width:117px;
background-image:url(../../images/sub_nav_up.jpg);
background-repeat:no-repeat;
padding-left:5px;
font-size:0.7em;
display:block;
padding-top:3px;
padding-bottom:0px;
text-decoration:none;
}
ul#subMenu a:hover {
color:#C50C09;
}
ul#subMenu a.active {
color:#FFFFFF;
background-image:url(../../images/sub_nav_down.jpg);
cursor:default;
}

/* THIRD LEVEL MENU */
ul#subMenu ul {
margin:0;
margin-left:17px;
margin-right:3px;
padding:0;
list-style-type:none;
}
ul#subMenu ul li a {
color:#FFFFFF;
margin: 0px;
height:14px;
width:100px;
background-image:url(../../images/third_level_up.jpg);
background-repeat:no-repeat;
padding-left:5px;
font-size:0.6em;
line-height:0.9em;
display:block;
text-decoration:none;
}
ul#subMenu ul li a:hover {
color:#C50C09;
}
ul#subMenu ul li a.active {
color:#FFFFFF;
background-image:url(../../images/third_level_down.jpg);
cursor:default;
}
/* END */

/* FORTH LEVEL MENU */
ul#subMenu ul ul {
margin:0;
padding:0;
margin-left:17px;
list-style-type:none;
}
ul#subMenu ul li ul li a {
color:#FFFFFF;
margin: 0px;
height:14px;
width:83px;
background-image:url(../../images/forth_level_up.jpg);
background-repeat:no-repeat;
padding-left:5px;
font-size:0.6em;
line-height:0.8em;
display:block;
text-decoration:none;
}
ul#subMenu ul li ul li a:hover {
color:#C50C09;
}
ul#subMenu ul li ul li a.active {
color:#FFFFFF;
background-image:url(../../images/forth_level_down.jpg);
cursor:default;
}
/* END */


#info {
position:absolute;
padding-right:10px;
padding-top:7px;
font-size:0.7em;
right:0px;
top:0px;
display:inline;
text-align:right;
overflow:hidden;
}
#logout {
position:absolute;
margin:0px;
padding:0px;
right:0px;
bottom:0px;
float:right;
height:43px;
width:100px;
display:block;
top:40px;
text-align:center;
}
#logout a {
background-image:url(../../images/logout_up.jpg);
background-repeat:no-repeat;
height:43px;
width:100px;
display:block;
text-decoration:none;
color:#FFFFFF;
font-size:0.8em;
padding-top:12px;
}
#logout a:hover {
color:#C50C09;
}
.hidden {
visibility:visible;
}
.message {
color:#FFFFFF;
background-color:#C50C09;
font-size:0.9em;
text-align:center;
}

@media print {
#framecontentLeft {
visibility:hidden;
}
#framecontentTop {
visibility:hidden;
}
#framecontentFilter {
visibility:hidden;
}
#footer {
visibility:hidden;
}
#contentArea {
margin:0;
border:0;
top:0;
left:0;
font-size:5pt;
}
#content {
margin:0;
border:0;
top:0 !important;
left:0;
}
.hidden {
visibility:hidden;
}
}

and the extra for ie:


#framecontentLeft {
position:absolute !important;
}
#framecontentTop {
position:absolute !important;
}
#framecontentFilter {
position:absolute;
}
#footer {
position:absolute !important;
}
#contentArea {
position:fixed;
overflow:auto;
}
* html body {
padding-top:93px;
padding-bottom:15px;
/*padding-left:126px;*/
padding-right:0px;
}
* html #contentArea {
height:100%;
width:100%;
}
* html framecontentTop {
width:100%;
}

I can't figure out how to get it to work.

Thanks in advance,

Rhys

shlajfka
11-13-2008, 07:13 PM
Hello. I had the same problem, but in my case, header and footer fixed. Ypu should now, that IE6 has many bugs. create a CSS style just for IE6, and in the head section of your page iput


<!--[if IE 6]>
<link href="yourstyle/folder/styleIE6.css" rel="stylesheet" type="text/css" />
</style>
<![endif]-->


this whould help :)

p.s. In your css style you have more than one fixed positions, make top left and bottom absolute.. and the content fixed, save it like i6style , and imput the code for calling style for ie6