Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS How to Make a Website Styling Web Pages and Navigation Style the Portfolio

I have two images side by side with no margin between them and no margin on the left. What am I doing wrong?

/************* 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: 20px; padding: 15%; font-size: 0.75em; color: #bdc3c7; }

Jennifer Hughes
Jennifer Hughes
11,421 Points

A quick suggestion:

You are missing a semi-colon after the margin property. Give that a try.

4 Answers

Thank you JH it worked.

Anirudh Bathini
Anirudh Bathini
904 Points

I have The same Issue, I have the same code, i even have the semi-colon, still wont work. i dunno how to resolve this.

my code is far is

/******************************************** Page : Portfolio *********************************************/

gallery {

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

gallery li{

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

Anirudh Bathini
Anirudh Bathini
904 Points

I got it, Sorry! i had :: after the margin, corrected that, works now :)

Good that you got it fixed AB. Do you need to put a space between li and { ?

Anirudh Bathini
Anirudh Bathini
904 Points

No I don't think you need spaces for brackets anywhere on the html or css docs, they work fine either way. It's just a preference of how you want your code to look , and i agree that it looks better with spaces. I usually make my code pretty once i have it working.