Cannot get respond.js to work IE8

I have the following HTML & CSS and a link to the referenced respond.js file I am using; https://github.com/scottjehl/Respond/blob/master/dest/respond.min.js

If I create a virtual directory in IIS and run the site from there, I get media queries working in all the browsers but IE8. I have studied the documentation and tried to make this example as simple as possible, I just cannot seem to get the functionality I require.

Would it be possible for someone to take a look and see where I could be going wrong.

Thanks for your time.

<!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">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Media Query Test</title>

    <link rel="stylesheet" type="text/css" href="css.css" />



</head>

<body>
    <div class="wrapper one">This box will turn to pink if the viewing area is less than 600px</div>
    <div class="wrapper two">This box will turn to orange if the viewing area is greater than 900px</div>
    <div class="wrapper three">This box will turn to blue if the viewing area is between 600px and 900px</div>
    <div class="wrapper iphone">This box will only apply to devices with max-device-width: 480px (ie. iPhone)</div>
    <p class="viewing-area">
        <strong>Your current viewing area is:</strong>
        <span class="lt600">less than 600px</span>
        <span class="bt600-900">between 600 - 900px</span>
        <span class="gt900">greater than 900px</span>
    </p>


    <script src="/js/respond.min.js"></script>

</body>
</html>
.wrapper {
    border: solid 1px #666;
    padding: 5px 10px;
    margin: 40px;
}

.viewing-area span {
    color: #666;
    display: none;
}

/* max-width */
@media screen and (max-width: 600px) {
    .one {
        background: #F9C;
    }

    span.lt600 {
        display: inline-block;
    }
}

/* min-width */
@media screen and (min-width: 900px) {
    .two {
        background: #F90;
    }

    span.gt900 {
        display: inline-block;
    }
}

/* min-width & max-width */
@media screen and (min-width: 600px) and (max-width: 900px) {
    .three {
        background: #9CF;
    }

    span.bt600-900 {
        display: inline-block;
    }
}

/* max device width */
@media screen and (max-device-width: 480px) {
    .iphone {
        background: #ccc;
    }
}

As I posted this a friend found the answer.

The problem was the following line;

<script src="/js/respond.min.js"></script>

Should have been

<script src="js/respond.min.js"></script>

-note I have removed the initial “/”

Thanks for your time.

Glad you sorted it :slight_smile: It always pays to check your paths.