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

Aaron Vowles
Aaron Vowles
6,376 Points

[ANSWERED]. Float function now working

I'm on stage 6 - styling web pages. I'm typing all of the code which has worked fine until I have introduced 'float'. My webpage wont show two pages side-by-side as demonstrated?

Here's my CSS & HTML, any ideas?

HTML <ul> <li id="gallery"> <a href="img/numbers-01.jpg"> <img src="img/numbers-01.jpg" alt="numbers"> <p>Experimentation with colour and texture.</p> </a> </li>


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

gallery {

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


gallery li {

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


4 Answers

Aaron Vowles
Aaron Vowles
6,376 Points

I had placed my 'id=gallery' within the li tag instead it should have been within the ul tag.

hop this helps

I don't see your HTML.

Aaron Vowles
Aaron Vowles
6,376 Points

sorry fixed it!!! placed the gallery in the wrong section - should have been within <ul>.

Thanks anyway!

You are welcome :)

Tom Page
Tom Page
1,283 Points

Aaron. Im having the same problem. You said that the gallery was in the wrong section and that it should have been "within". What exactly did you mean? Did you move #gallery in your css file? If so, where to? Many Thanks!

I have the same question as Tom