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 Styling Web Pages and Navigation Style the Portfolio

why main.CSS #gallery wount work?

i think everything is ok, but it wount work like in the video

index.html

<div class="wrapper"> <section> <ul id="gallery"> <li> <a href="img/numbers-01.jpg"> <img src="img/numbers-01.jpg" alt=""> <p>Eksperments ar bildēm un tekstu</p> </a>
</li> <li>

main.css

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

gallery {

margin: 0; padding: 0; list-style: none; } /before gallery ther is #/

gallery li {

float: left; list-style-type: none; width: 45%; margin: 2.5%; background-color: #f5f5f5; color: #bdc3c7;
} /before gallery ther is #/

3 Answers

Steven Parker
Steven Parker
241,488 Points

Your HTML seems to be missing the closing tags for the UL and SECTION elements.

No, i think they are in right places!

<div class="wrapper"> <section> <ul id="gallery"> <li> <a href="img/numbers-01.jpg"> <img src="img/numbers-01.jpg" alt=""> <p>Eksperments ar bildēm un tekstu</p> </a>
</li> <li> <a href="img/numbers-02.jpg"> <img src="img/numbers-02.jpg" alt=""> <p>Kautkāda bilde</p> </a>
</li> <li> <a href="img/numbers-06.jpg"> <img src="img/numbers-06.jpg" alt=""> <p>Tas neesmu es</p> </a>
</li> <li> <a href="img/numbers-09.jpg"> <img src="img/numbers-09.jpg" alt=""> <p>Opā lilā</p> </a>
</li> <li> <a href="img/numbers-12.jpg"> <img src="img/numbers-12.jpg" alt=""> <p>Džiranimo</p> </a>
</li> </ul> </section>

I think the issue is that you forget the hash '#' before the gallery ids in your css :

#gallery {  /* Add '#' to gallery id */

margin: 0;
padding: 0;
list-style: none;
 } 
#gallery li { /* Add '#' to gallery id */

float: left;
 list-style-type: none;
 width: 45%;
 margin: 2.5%;
 background-color: #f5f5f5;
 color: #bdc3c7;
} 

Hope that helps!!

Thanks, but i all ready done that!

Thanks for answers, now it works perfect!

how did u solve it?

I knew that i write the code right, so i restart my browser and it worked!