Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

No idea why responsive not working. Please help.

Hello I am trying to make responsive website but the media queries are not taking effect. Please help code below. HTML & CSS for home page.

<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="description" content="Woodpecker London Ltd">
    <title>Woodpecker London Ltd</title>
    <link rel="stylesheet" type="text/css" href="css/normalize.css" media="screen">
    <link rel="stylesheet" type="text/css" href="css/style.css" media="screen">
</head>
<body>
    <div class="container">
        <div class="header">
            <a class="logo" href="index.html"><img src="images/logo.png"></a>
            <nav id="nav-one">
                <ul>
                    <li><a href="index.html">Home</a></li>
                    <li><a href="about.html">About</a></li>
                    <li><a href="process.html">Process</a></li>
                    <li><a href="contact.html">Contact</a></li>
                </ul>
            </nav>
        </div>
        <div class="header-two"><span class="tele"></span><nav class="nav-two">
            <ul>
                <li><a href="#">Bedrooms</a></li>
                <li><a href="#">Living Rooms</a></li>
                <li><a href="#">Kicthen</a></li>
                <li><a href="#">Bathrooms</a></li>
                <li><a href="#">Home Offices</a></li>
            </ul>
        </nav>
        </div>
        <div id="display">
            <ul class="rslides">
                <li><img src="images/display-one.jpg" alt=""></li>
                <li><img src="images/display-two.jpg" alt=""></li>
                <li><img src="images/display-three.jpg" alt=""></li>
             </ul>
        </div>
        <div id="content" class="clearfix">
            <div id="intro">
            <h1>Welcome to Woodpeckers London</h1>
            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla in tempor enim, nec rutrum quam. Curabitur lacinia dolor pellentesque, facilisis dolor ut, eleifend elit. Maecenas fringilla iaculis justo ac dapibus. In arcu tortor, elementum mollis elit a, feugiat hendrerit justo. Nunc ultrices sapien sit amet magna iaculis tincidunt. Nunc euismod vulputate condimentum. Phasellus fringilla nisi tellus, ac sagittis felis posuere a. Donec ullamcorper venenatis mauris id iaculis. Aenean mi sem, fermentum vitae libero non, consequat lobortis mauris. Sed adipiscing molestie vestibulum. Ut hendrerit leo lacinia, feugiat justo at, tempus tellus.</p>
            </div>
            <div id="sidepanel">
                <div id="advert"><a href="#"><p>Book Your Free<br class="higlight" >Visit</a></div>
                <div id="why-us"><h2>Why Us?</h2>
                <ul>
                    <li>- Bespoke Designs</li>
                    <li>- 1 Week installation</li>
                    <li>- 5 years guarantee</li>
                    <li>- Centralised Operations</li>
                </ul>
                </div>
            </div>
            <div id="testimonials"><h3>Tesimonials</h3><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla in tempor enim, nec rutrum quam. Curabitur lacinia dolor pellentesque, facilisis dolor ut, eleifend elit.</p></div>
            <div id="portfolio">
            </div>
        </div>
        <div class="footer"></div>
    </div>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
    <!--<script src="scripts/responsiveslides.min.js"></script>-->
    <script>
      $(function() {
        $(".rslides").responsiveSlides();
      });
    </script>
</body>
</html>
body {
    width: 100%;
    margin: 0;
    padding: 0;
     -webkit-box-sizing: border-box;
     -moz-box-sizing: border-box;
          box-sizing: border-box;
}

body a {
    text-decoration: none;
}

.container {
    margin: auto;
    width: 64em;
}

/* Main Header */

.header {
    position: relative;
    width: inherit;
    height: 8.75em;
    margin: auto 0;
    background-color: blue;
}
/* Main Header Navigation */

.header nav {
    position: absolute;
    right: 0%;
    bottom: 15%;
    margin: 0;
    padding: 0; 
}

.header ul {
    list-style: none;
}

.header li {
    float: left;
    margin: 0 0.5em 0 0.5em;
}

.header a {
    color: #fff;
}

/* Second Header*/

.header-two {
    position: relative;
    width: inherit;
    height: 2.3125em;
    margin: 0;
    background-color: red;
}

/* Second Header Navigation*/


.header-two nav {
    position: absolute;
    right: 0%;
    bottom: 0%; 
}

.header-two ul {
    margin: 0 ;
    padding: 0; 
    list-style: none;
}

.header-two li {
    float: right;
    margin: 0 0.5em 0 0.5em;
    line-height: 2.3125em;
}

.header-two a {
    color: #fff;
}

/* Logo*/

.logo img {
    position: absolute;
    bottom: 15%;
}

/* Display*/

#display {
    width: inherit;
    height: 24.25em;
}

/* Slider*/

.rslides {
  position: relative;
  list-style: none;
  overflow: hidden;
  width: 100%;
  padding: 0;
  margin: 0;
  }

.rslides li {
  -webkit-backface-visibility: hidden;
  position: absolute;
  display: none;
  width: 100%;
  left: 0;
  top: 0;
  }

.rslides li:first-child {
  position: relative;
  display: block;
  float: left;
  }

.rslides img {
  display: block;
  height: auto;
  float: left;
  width: 100%;
  border: 0;
  }

/* Main Content*/

#content {
    position: relative;
    width: inherit;
    margin: 0.09765% 0 0 0;
}

#intro {
     -webkit-box-sizing: border-box;
     -moz-box-sizing: border-box;
          box-sizing: border-box;
}

#intro h1 {
    float: left;
    width: 42.28515%;

}

#intro p {
    float: left;
    width: 62.210937%;
}

/* SidePanel*/

#sidepanel {
    background-color: green;
    float: right;
    width: 29.29687%;
    height: 6em;
    margin: -9.6% 0 0 0;
}

/* Why Us*/

#why-us {
    padding: 0;
    float: right;
    width: 100.29687%;
    margin: 15% 0 0 0;
     -webkit-box-sizing: border-box;
     -moz-box-sizing: border-box;
          box-sizing: border-box;
}

#why-us h2 {
    margin: -1% 0 0 0;
    width: 100.29687%;
}

#why-us ul {
    width: 100.29687%;
    list-style-type: none;
    width: 87.29687%;
}

#why-us li {
    margin: 2.5% 0 0 0;
}

/* Testimonials*/

#testimonials {
    width: 62.210937%;
    height: 10em;
    float: left;
}

#testimonials h3 {
    width: 62.210937%;
}

#testimonials p {
    width: 62.210937%;
}

/* Portfolio*/

#portfolio {
    float: right;
    background-color: blue;
    width: 29.29687%;
    height: 10em;
}

/* Footer*/

.footer {
    margin: 2.09765% 0 0 0;
    width: inherit;
    height: 5em;
    background-color: green;
}


/* Clear Fix */

.clearfix:after {
    clear: both;
    display: block;
    content: " ";
    height: 0px;
    visibility: hidden;
}
.clearfix {
    display: inline-block;
}
/* Hide these rules from IE-mac \*/
* html .clearfix {
    height: 1%;
}
.clearfix {
    display: block;
}
li.clearfix {
    display: list-item;
}
/* End hide from IE-mac */ *zoom: 1;
}



/* Media Queries */ 

@media screen and (max-width: 680px) {
    #intro {
        width: 100%;
    }

}

1 Answer

Make sure you have your viewport meta tag within your head in your HTML.

Thanks :)

Thanks :)