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