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 trialSean Gedorio
301 PointsContainer for half/half layout?
Hello, I'm a high school student working on a school club website. I'm still new to all of this & I haven't written any code yet, but I would like some guidance/directions as to how I can achieve the layout of the first page of my website.
MOBILE DESIGN: http://i.imgur.com/1OnyYSB.jpg DESKTOP DESIGN: http://i.imgur.com/EAcqwsT.jpg
I have 2 main concerns:
1) Is there a way to create a container for each half of the website? Say if I want to center one thing in one half without it interfering the other half... Is that possible? I really want to follow through with this design but have no idea how to set limits or contain one half of the page.
2) How can I set the two containers on top of each other in the mobile layout? I already finished one of the HTML/CSS projects in the library and it mentioned to start first with a mobile layout. Should I set a max-height so it can be scrollable or...?
If you have any other advice, please feel free to comment and help :) I would greatly appreciate it. Thank you.
1 Answer
Stefan Osorio
16,419 PointsYou can easily achieve this with media queries - rules that allow you to apply different styles depending on certain conditions (like screen resolution).
The Project "How to Make a Website" has an segment about this :) http://teamtreehouse.com/library/how-to-make-a-website/responsive-web-design-and-testing/responsive-web-design
Sean Gedorio
301 PointsSean Gedorio
301 PointsAhhh yes thank you, but I was wondering more on how to set containers? Like in the image template above I want to center one image and its caption in 1/2 the page and in the other 1/2 I want to align completely differently... So it's basically 2 different pages in 1. Is this difficult to do in CSS? Sorry I'm very new to this thing.
Stefan Osorio
16,419 PointsStefan Osorio
16,419 PointsLike this? http://codepen.io/anon/pen/EzGnm
Not difficult at all, should also be covered in the previously recommended Project :)