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 Build a Responsive Website Responsive Design Content Defined Breakpoints

Grab and resize.

Hi, if i grab my browser from a wide screen to a smaller one, my web site don't scale, seems like the media query didn't works properly, but, if I use chrome extension and other development tool for screen size test, my media query works!

How i can solve this problem?

ps: Are there even English courses in treehouse? ;)

2 Answers

Keith Kelly
Keith Kelly
21,326 Points

So it sounds like it is only working when the screen refreshes. Can you post your CSS code or possibly share the code through a workspace so we can test it?

Even if i refresh the page nothing change. CSS:

'''@media screen and (max-width : 320px){ .grid_1, .grid_2, .grid_3, .grid_4, .grid_5, .grid_6, .grid_7, .grid_8, .grid_9, .grid_10, .grid_11, .grid_12 { width: 100%; }

ul.nav{ 
    float: none;
}

li{
    display: table;
    text-align: center;
}

}'''

HTML '''<body> <div class="container clearfix">

    <div class="grid_2">
            <h1>01 / 01</h1>
    </div>

            <div class="10 omega">
        <div id="?">
            <h3>?</h3>
            <img src="img/mywork/my.jpg">
        </div>
    </div>

    <div class="grid_2">
        <div class="full_scale_height">
            <ul class="nav">
                <li><p><a href="#?">?</a></p></li>
                <li><a href="#censured">censured</a></li>
            </ul>
        </div>
    </div>....'''
Keith Kelly
Keith Kelly
21,326 Points

It looks like the rule doesn't kick in until your screen size is 320px or less since you set the max-width to that size. Unless you have a width set to a percentage for your global css then you wouldn't see the screen change at all until you get your browser size down to 320px.