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

Emils Bisenieks
Emils Bisenieks
751 Points

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
231,248 Points

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

Emils Bisenieks
Emils Bisenieks
751 Points

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>

Grace Kelly
Grace Kelly
33,990 Points

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!!

Emils Bisenieks
Emils Bisenieks
751 Points

Thanks, but i all ready done that!

Emils Bisenieks
Emils Bisenieks
751 Points

Thanks for answers, now it works perfect!

Orion Adler
Orion Adler
1,497 Points

how did u solve it?

Emils Bisenieks
Emils Bisenieks
751 Points

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