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

HTML How to Make a Website Responsive Web Design and Testing Adding Breakpoints for Devices

The gallery layout doesn't switch to 2 column layout when resizing the browser window.

I've linked the index.html to the responsive.css but when I resize the browser window, it doesn't look like the example in the video, and I have 3 columns instead of 2 columns.

Joel Hernandez I think they meant that they linked the CSS to their HTML file.

1 Answer

Did you link the new responsive.css file after the first main.css file? That might be the problem.

Also, double check your syntax on the media queries. Make sure you don't use a semicolon in the parentheses!

If you're still stuck, review the video.

Thank you for your help Nathaniel, yes I linked the responsive.css file after main.css file, just like in the video. Yes I made sure that I used a colon in the media queries. I reviewed the video to see what I may have missed. Total newbie question, how do i post the responsive.css so that Joel can have a look? I clicked on the camera icon in the upper right corner of workspace to take a snapshot of the index.html and of the responsive.css so that you can look, and it created two links, how do I post those?

For now I just copied and pasted the top part of the code from index.html

```<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Augusto J. Ferriols | Designer</title> <link rel="stylesheet" href="css/normalize.css"> <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700,300' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="css/main.css"> <link rel="stylesheet" href="css/responsive.css"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head>

and here's the first part of responsive.css

@media screen and (min-width: 480px) {

/**************************************
TWO COLUMN LAYOUT ***************************************/

#primary { width: 50%; float: left; }

#secondary { width: 40%; float: right; }

/**************************************
PAGE: PORTFOLIO ***************************************/

#gallery li { width: 28.3333%; }

#gallery li:nth-child(3n + 1) {

clear: left;

}