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

sebbe12
sebbe12
4,015 Points

Should i use position in 2018. Position is really weird when the screen size changes and makes the website look shit

Should i use position. Position is weird when the screen sizes change ever so slightly

Cooper Runstein
Cooper Runstein
11,850 Points

Yes, there are many cases you need to use position.

sebbe12
sebbe12
4,015 Points

@Brandyn Lordi i can't see the example even after joining the seasson. Everything is empty.

And how do i deal with position elements like absolute when i resize the screen since it isn't in the documents flow. When i use position:absolute and then just change the screen size 50px it looks aweful.

2 Answers

Steven Parker
Steven Parker
231,248 Points

The problem is not "position" but more likely with the units. Just in general, you won't want to use pixel units for responsive page design.

To make positions work responsively, you can use screen-relative units or percentages. You could also use "calc()" and compute adjustments yourself.

Zack Jackson
Zack Jackson
30,220 Points

Whoops. Apparently I commented instead of answering.

Are you using px or rem in your css? This would make a big difference since px are fixed and won't adapt.

Position has its uses, but everything has its place and perhaps, for your use in this particular case, position is not suited for what you are trying to achieve. There are numerous ways to skin a cat with CSS.