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

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>


CSS

/******************************* 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