I have created a website using HTML 5 with resolution tags for a wide and medium layout. When testing my website I found that it works in IE9, chrome, firefox, safari but not IE8 and older. The CSS links I have used are below;
<link rel="stylesheet" type="text/css" href="style.css"/>
<link rel='stylesheet' media='screen and (max-width: 900px)' href='medium.css' />
<link rel='stylesheet' media='screen and (min-width: 901px)' href='wide.css' />
Currently upon opening the website, it has no divs or styling therefore I believe it has something to do with linking to the CSS style sheets. I have used div tags within my html;
Example:
<div id ="container">
<div id ="header">
<div id = "logo">
<img src="images/Logo.jpg" height = "180" width = "300" alt = "Oops!">
</div>
<div id = "small-logo">
<img src="images/SmallLogo.jpg" alt = "Oops!">
</div>
</div>
I am not an expert and any information would be extremely helpful.
EDIT:
I have tried using:
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js'></script >
<script type='text/javascript' src='resolution-test.js'></script>
Using javascript:
function adjustStyle(width) {
width = parseInt(width);
if (width < 900) {
$("#size-stylesheet").attr("href", "medium.css");
} else {
$("#size-stylesheet").attr("href", "wide.css");
}
}
$(function() {
adjustStyle($(this).width());
$(window).resize(function() {
adjustStyle($(this).width());
});
});
The webpage is now only seeing the style sheet? Are there any problems with this code?