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 Build a Three Column Layout

Trying to get from 2 to 3 collums on the photo gallary

I can't seem to get from 2 to 3 columns on the photo gallery page.

Here is the responsive.css page code I have

Thanks

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

/* ********************************* Two Collumn Layout ***********************************/ #primary { width: 50%; float: left; }

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

/* ********************************* page portfolio ********************************/ ********************************/

#gallery li { width: 28.3333%; }

#gallery li:nth-child(4n) { clear: left; } }

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

} '''

3 Answers

Dale Severude
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Dale Severude
Full Stack JavaScript Techdegree Graduate 71,350 Points

Hi Ryan, It looks like you have the necessary response.css code to have 3 columns. Do you have #gallery id defined within your ul portion of index.html?

I believe so ....

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Ryan Stockdale | Designer</title> <link rel="stylesheet" href="css/normalize.css"> <link href='https://fonts.googleapis.com/css?family=Changa+One|Open+Sans:400,400italic,700,700italic,800' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="css/main.css"> <link rel="stylesheet" href="css/responsive.css"> </head> <body> <header> <a href="index.html" id="logo"> <h1>Ryan Stockdale</h1> <h2>Designer</h2> </a> <nav> <ul> <li><a href="index.html" class="selected">Portfolio</a></li> <li><a href="about.html">About</a></li>
<li><a href="contact.html">Contact</a></li> </ul> </nav> </header> <div id="wrapper">

    <section>
      <ul id="gallery">
        <li>
          <a href="img/numbers-01.jpg">
              <img src="img/numbers-01.jpg" alt="">
              <p>Experimentation with color and texture.</p>
            </a>
       </li>
        <li>
          <a href="img/numbers-02.jpg">
              <img src="img/numbers-02.jpg" alt="">
              <p>Experimentation with color and texture.</p>
            </a>
       </li>
        <li>
          <a href="img/numbers-06.jpg">
              <img src="img/numbers-06.jpg" alt="">
              <p>Experimentation with color and texture.</p>
            </a>
       </li>
       <li>
          <a href="img/numbers-09.jpg">
              <img src="img/numbers-09.jpg" alt="">
              <p>Experimentation with color and texture.</p>
            </a>
       </li> 
        <li>
          <a href="img/numbers-12.jpg">
              <img src="img/numbers-12.jpg" alt="">
              <p>Experimentation with color and texture.</p>
            </a>
       </li>



        </ul>   
    </section>
    <footer>
      <a href="http://twitter.com/RyanPStockdale"><img src="img/twitter-wrap.png" alt="Twitter Logo" class="social-icon"> </a>
      <a href="http://facebook.com/ryanPStockdale"><img src="img/facebook-wrap.png" class="social-icon" alt="Facebook Logo"> </a>
    <p>&copy; 2015 Ryan Stockdale.</p>
    </footer>
  </div>

</body> </html>

Dale Severude
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Dale Severude
Full Stack JavaScript Techdegree Graduate 71,350 Points

In index.html you are missing a call to your main.css file. I think this is causing the issue you are seeing.

    <link rel="stylesheet" href="css/main.css">

Also missing are the type declaration and the html, head and body containers. These are not causing this specific issue, but are good practice to use.

<!DOCTYPE html>
<html>
  <head>
      <!-- Metadata -->
  </head>
  <body>
      <!-- Content of document -->
  </body>
</html>