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 Layout Basics Positioning Page Content How Absolute Positioning Works

sebbe12
sebbe12
4,015 Points

How do you even use position with diffrent screensizes

When I use position relative and absolute it works fine with the screen size I use but if I change the screensize like 30px it dosen't look perfect since it floats to the left. So if I was to use absolute position I would need like 10-20 medias to make it look good on every screensize or am I missing something.

1 Answer

I’d have to see what you’re referring to, but as a side note:

Media queries are used to adapt to different screen sizes. Things used to be different for developers - you’d make two sites, one for. Desktop, and the other for mobile. The mobile site was a nice extra to offer, but it’s now expected to just be made at the same time.

So, when you use a media query for a mobile size for example, you’ll be able to use selectors like usual and adjust for the smaller screens. You can add break points for tablets and desktops too, so that the design always will look nice.

Typically, I think 3 breakpoints are good (mobile, tablet, desktop). You could throw in another for landscape mode if you’d like too.