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 CSS Basics (2014) Enhancing the Design With CSS Adjusting the Layout with Media Queries

Kyle Vassella
Kyle Vassella
9,033 Points

How to prevent overlapping elements in Tahoe Site?

On the Tahoe Website (CSS Basics Course) everything seems to look fine down to about Iphone size. But when on a desktop browser, if I play around with the window and make it even narrower, the .intro text overlaps the header in a nasty way:

ugly overlapping

I realize that not many people would ever see this problem, but how do I prevent something like this within the CSS if I'm picky and want this to not happen at a very narrow width on the desktop? So far my code is the same as the Treehouse Teacher's.

4 Answers

Kyle Vassella
Kyle Vassella
9,033 Points

Well, I just remembered I have my Chrome's font size set to 'large' instead of the default 'medium'. So I guess that explains why his probably doesn't act that way (on Medium, this issue does not occur).

But what about those people who do have the font size set above 'medium'? I guess even though I pretty much solved my issue I could still ask the question. I know a lot of people who prefer the larger font sizes, so how might something like this be prevented?

I guess another media query with smaller font sizes could do the trick. Is there another way or is a new media query for tiny widths the best solution?

James Tonkin
James Tonkin
9,094 Points

Wow, same for me. I was racking my brain and checking my code. Once I set Chrome font size back to medium it was fine. Thanks for this.

Kresimir Bratkovic
Kresimir Bratkovic
5,618 Points

I have the same problem. I made new media querie rule for devices smaller then 561px and solved the problem.

@media (max-width: 561px) { .primary-content { margin-top: 100px; } }

Alex Thomas
Alex Thomas
4,247 Points

That is a great solution. Can you tell me how you came up with the numbers?

maybe some ckinda padding