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 How to Make a Website Styling Web Pages and Navigation Style the Image Captions

styling web page

i was following the video, did everything he has done, but its seems that the side by side pic in the gallery section in css isnt doing it on my web page.

can you post your code please?

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

gallery { margin: 0; padding: 0; list-style: none; }

gallery li { float: left; width: 45%; margin: 2.5%; background-color: #f5f5f5; color: #bdc3c7; }

gallery li a p { margin: 0; padding: 5%; font-size: 0.75em; color: #bdc3c7; }

t wasnt floating side by side.. back ground color isnt happenig, and i have set list style on none, but then bullet is still there

6 Answers

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

gallery {

margin: 0; padding: 0; list-style: none; }

gallery li {

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

gallery li a p {

margin: 0; padding: 5%; font-size: 0.75em; color: #bdc3c7; }

ul id: "gallery"> <li> <a href="img/sofia.jpg"> <img src="img/sofia.jpg" alt=""> <p>Experemental with images.</p> </a> </li> <li>

it wasnt floating side by side.. back ground color isnt happenig, and i have set list style on none, but then bullet is still there.

Hey Melissa it seems like the problem is that since it uses "id" attribute, you have to use # along with id name. in this case #gallery. I am sure this will solve the problem but if it does not solve the problem, then make sure to check if you link your css to html correctly.

<link rel="stylesheet" href="(the path of your stylesheet.css)">

yeah # was there.. it wasn't just working i don't know why. i religiously followed everything. i guess the image that i attached is too big so it wont fit side by side? but then i was surprise even my code for the list style, background color aren't working.. thank for the reply though.

how about the other codes that you put in css file, do they work? if so then try clear:both see if that solves the problem.

hey daniel! i got. HTML isnt on proper code. my bad.

Good to hear. You fixed. No problem. Oh you mean that ul id = "gallery"?? didn't see that lol. Thought that was fixed too.

clear:both isnt working too.

lol. i checked it tgoroughly and then boom! i was stupid and didnt put the = sign.