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

Help with Css layouts?

Hi,

I've watched the html and css videos and I can pretty much do all of that stuff.

The one thing I'm struggling with is positioning elements.

I want to be able to make a website that has multiple content boxes next to each other like Twitter has.

Could anyone tell me how to, for example, put three different boxes side by side with a little space between them? I assume you use the Display and Positioning functions but I'm not sure how.

Thanks :)

Watch CSS layout technique course.

just set the section that you are doing or class to max-width:100%, then set the padding to whatever percentage. After that calculate the perfect percentage for each image, ex: 2.5% padding for left and right. 3 images or boxes total for each row. 2.5 * 2 * 3 = 15% just for the space between combined. 100-15 = 85%. 85 /3 = 28.333. .img-content { width:28.333%; }

or learn to use bootstrap it will pay off.

1 Answer

HI, dont go into bootstrap, ud regret it :)

What you can do instead, is to watch what other people mentioned Layout Techniques and what you can do, is read blog about it as well as check out CSS Tricks and you will learn best practices.

It will take a bit of time.

After you are comfortable with it, you can position stuff most likely how you want, you can then use a framework like bootstrap .

Im telling you it from my own experience . It might be different for you , but if you learn it without bootstrap first, ud learn a lot more, and then when you use bootstrap, you learn even more and then you can drop it, and learn even more, and or keep foundatoin or bootstrap or either make ur own grid system or flex-box .

Hope it helps :) Give ur self a month or two to be any good with CSS unless you have more time to spend at it .