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

General Discussion

Guidance

i just need assitance/guidance on making a layout just like this website. i have a good understanding of css and html but just a little help on where to start would be greatly appreciated.

http://www.helmutlang.com/helmut-lang-all/all-items,default,sc.html

Hi Rashii,

Unfortunately I can't be of much help on this one - but I just had to comment that I have never seen so many blank lines in an HTML file before! There are about 90 blank lines between <html xmlns="http://www.w3.org/1999/xhtml"> and the <head> tag - weird! No doubt your version of this layout will be tidier and more compact - best wishes on that, please keep us updated here!

  • Luca

I agree Luca, the files were very confusing, and the URL was as well. I agree, I'm sure yours will be much better.

2 Answers

I'll be honest, I love Wordpress for everything, so I'm going to go ahead and recommend building a theme for something like this, but as far as the layout:

The layout seems like its got each of the boxes having set widths and heights, not percentages, and all the elements have the block layout, because when you resize the browser they jump below one another.

I'd say set a pixel width on the blocks, and use a php function that basically just says for each item I have under this post type, make the block look like this, and float them left, that way you'll get them all lined up nicely.

I'm not sure if this helped at all but these are a few things that struck me when I say the webpage.

Hello Rashii

I think your starting point would be to use CSS media queries to define the amount of "image boxes" that should be displayed. So basically something like the snippet below where each .box contains an image (of course you could also have it display more than three boxes by adding an additional breakpoint). I've used this approach in the past for a layout which was very similar to what you want to achieve...

@media only screen and (max-width : 480px) {
/* Smartphones: 1 image per row */
.box {
  width: 100%;
}
}
@media only screen and (max-width : 650px) and (min-width : 481px) {
/* Tablets: 2 images per row */
.box {
  width: 50%;
}
}
@media only screen and (min-width : 651px) {
/* large screens: 3 images per row */
.box {
  width: 33.3%;
}
}