I designed a layout, that you can see here, with a fixed header, a fixed menubar, contents inside boxes arranged in two columns, and a footer, plus a border around the whole <body>
element. It works exactly as I want (tested with Iceweasel 38.2 and Internet Explorer 11).
The problem is: when I try to move the style sheet to an external css file, it doesn't work any more. The result looks like this.
I can't understand why the appearance of the page changes since the styles and the html are exactly the same. Thje external CSS does not contain the tags.
This is the source css/html for the working page:
<style>
body {
height: 100%;
color: black;
background: white;
border-width: 4px;
border-style: solid;
border-color: black;
padding: 0;
margin: 0 auto;
max-width:1024px;
}
#left {
margin:0;
margin-right: -4px;
margin-top: 183px;
padding:0;
float:left;
width:65%;
background:red;
}
#right {
margin:0;
padding:0;
margin-top: 183px;
float:right;
width:calc(35% + 4px);
left: -4px;
background:blue;
}
.boxleft {
padding-bottom: 10px;
padding-left:20px;
padding-right:20px;
border-style: solid;
border-color:black;
border-top-width:0px;
border-left-width:0px;
border-right-width:4px;
border-bottom-width:4px;
float:left;
width:calc(100% - 44px);
}
.title {
background-color:blue;
color:white;
}
.rating {
background-color:red;
color:white;
}
.boxright {
padding:20px;
border-style: solid;
border-color:black;
border-top-width:0px;
border-left-width:4px;
border-right-width:0px;
border-bottom-width:4px;
float:right;
width:calc(100% - 44px);
}
.poster {
background-color:green;
color:white;
}
#header {
background-image:url('Title background03.png');
background-repeat: no-repeat;
position:fixed;
width: 100%;
max-width:1024px;
margin: 0px auto;
height:119px;
top: 0;
}
#footer {
background:white;
position:fixed;
width:100%;
max-width:1024px;
bottom: 0;
padding: 0px;
border-top-style: solid;
border-bottom-style: solid;
border-color:black;
border-top-width:4px;
border-bottom-width:4px;
}
#menu {
background:black;
position:fixed;
color:white;
width:100%;
max-width:calc(1024px - 24px);
z-index:200;
margin: 0px auto;
top:115px;
height:64px;
padding-top:12px;
padding-left:24px;
/* z-index: 1; */
}
</style>
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div id="header">
</div>
<p id="menu">menu1 - menu2 - menu3</p>
<div id="left">
<div class="title boxleft">
<p>title</p>
</div>
<div class="rating boxleft">
<p>rating</p>
</div>
</div>
<div id="right">
<div class="poster boxright">
<p>poster</p>
</div>
</div>
<div id="footer">
<P>copyright</P>
</div>
</body>
</html>