Reputation: 57
I've been working on a midterm site for my current Web Development class and have encountered a problem I haven't been able to find a solution to. IE11 (and possibly earlier versions) don't seem to like my layout and I'm not sure why. Everything displays fine in Firefox and Chrome. This is the link: http://auharvey.com/1510/midterm/index.html
Any help would be greatly appreciated!
#wrapper {
width: 800px;
margin-left: auto;
margin-right: auto;
background-color: #855321;
}
body {
background-color: #e6c6a6;
font-family: calibri, sans-serif;
}
header, nav, main, footer {
display: block;
}
/* a:link {
color: #855321;
}
a:hover {
color: #4c9860;
}
a:visited {
color: #855321;
}
*/
header {
background-color: #cc9966;
border: 3px solid #855321;
margin: 0;
padding: 0 10px;
}
nav {
margin: 0;
padding: 0;
height: 24px;
border: 3px solid #855321;
}
nav ul {
list-style-type: none;
padding: 0;
margin: 0;
}
nav li {
display: inline;
margin: 0;
padding: 0;
}
nav a {
display:inline-block;
width: 262px;
height: 24px;
background-color: #cc9966;
color: #855321;
text-align: center;
text-decoration: none;
text-transform: uppercase;
line-height: 24px;
font-weight: bold;
margin: 0;
padding: 0;
}
nav a:hover {
background-color: #4c9860;
color: #855321;
}
nav a:visited {
color: #855321;
}
#container {
width: 800px;
background-color: #ff0000;
}
main {
display: block;
min-height: 290px;
background-color: #cc9966;
border: 3px solid #855321;
margin: 0;
padding: 0 10px;
}
#main-right {
float: right;
width: 374px;
min-height: 290px;
background-color: #cc9966;
border: 3px solid #855321;
margin: 0;
padding: 0 10px;
}
.highlight {
background-color: #4c9860;
font-weight: bold;
font-style: italic;
}
.float-left {
float: left;
width: 374px;
}
.float-right {
float: right;
padding: 0;
margin: 10px 5px 10px 10px;
}
ul {
list-style-type: square;
line-height: 150%;
}
footer {
clear: both;
background-color: #cc9966;
border: 3px solid #855321;
font-size: small;
text-align: center;
margin: 0;
padding: 0;
}
<!DOCTYPE html>
<html lang="en">
<head>
<title>Enoch Treadwell's Trash Service</title>
<meta charset="utf-8">
<link rel="stylesheet" href="styles.css">
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js">
</script>
<![endif]-->
</head>
<body>
<div id="wrapper">
<header role="banner">
<h1>Enoch Treadwell's Trash Service</h1>
</header>
<nav role="navigation">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="services.html">Services</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</nav>
<div id="container">
<main role="main" class="float-left">
<h3>Who We Are</h3>
<p>Enoch Treadwell's Trash Service is the new option in your town for all your trash disposal needs! Weather your looking for a weekly trash pick up or just a one time pick up by appointment we are the best choice! We offer great rates on all our trash disposal services! We even have a special offer for year contracts for weekly pick-up service at the low price of 15.99 a month! Please visit our convenient location at blah blah blah or give us a call at (999) 555-1234 between the hours of 8 to 5 M-F or 10 to 2 on Saturday.<p>
</main>
<div id="main-right">
<img src="special2.png" class="float-right" width="100" alt="Specials">
<h3>Specials</h3>
<ul>
<li><span class="highlight">10% OFF</span> Dumpster Rental for bulk</li>
<li><span class="highlight">$15.99 </span> a month for Weekly Pick-Up with a one year contact.</li>
<li><span class="highlight">20% OFF</span> Pre-Sorted Recyclables</li>
<li>Discounted rates for Monday pick-ups.</li>
</ul>
</div>
</div>
<footer role="contentinfo">
<a href="index.html">Home</a> | <a href="services.html">Services</a> | <a href="contact.html">Contact</a><br>
Copyright © 2014 Alyssa Harvey<br>
<a href="mailto:[email protected]">[email protected]</a>
</footer>
</div>
</body>
</html>
Upvotes: 2
Views: 891
Reputation: 336
Well, i can't comment because i don't have my 50 Reputations, but here's an additional tip:
Don't user Pixel (px) so your website is mor flexible for Displays with much smaller Width/height.
define in your body{} in the css:
body{
width: 100%;
font-size: 100%;
}
and use for font size in other classes/ids this:
#example{
font-size: 1em;
}
Here is em equal to the normal font-size defined in the body{}.
1 em = normal font size.
2 em = font-size * 2...
http://www.w3.org/Style/Examples/007/units.en.html
Upvotes: 0
Reputation: 1825
Replace main with the following code. Seems you are missing an ending p tag
<main role="main" class="float-left">
<h3>Who We Are</h3>
<p>Enoch Treadwell's Trash Service is the new option in your town for all your trash disposal needs! Weather your looking for a weekly trash pick up or just a one time pick up by appointment we are the best choice! We offer great rates on all our trash disposal services! We even have a special offer for year contracts for weekly pick-up service at the low price of 15.99 a month! Please visit our convenient location at blah blah blah or give us a call at (999) 555-1234 between the hours of 8 to 5 M-F or 10 to 2 on Saturday.</p>
</main>
Upvotes: 2