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 trialdemiandaniel
1,252 PointsCannot manage to make three column work
I've finished the video and was following Nick each step, tho at the end I've not managed to make my 3 column work, as it's stuck on 2 :\
/************************ 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.85em;
color: #bdc3c7;
height: 2em;
}
/************************
Two column layout
************************/
#primary {
width: 50%;
float: left;
}
#secondary {
width: 40%;
float: right;
}
/************************
PAGE: Portfolio
************************/
#gallery li {
width: 28.3333%;
}
#gallery li:nth-child(4n) {
clear:left;
}
}
Sahil Prajapati
8,524 PointsSahil Prajapati
8,524 PointsHi
In the above code you are dividing the row into two columns:
So the total width becomes greater than 100%.
Change the width to 28.33% like this:
And now the total width of the row will be 100%. (Now each li element will have a width of 33.33% (2.5% + 28.33%+ 2.5%).