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
Jacob Thomson
757 PointsUsing the position property
I'm currently positioning my photos and text within my divs, using:
position: absoloute;
I have created a desktop version of my website, and soon want to use media queries to make it responsive for a mobile version. Will using the position property cause any problems when trying to scale my website to a mobile version?
1 Answer
Nick Pfisterer
8,064 PointsAs long as you are using the position property correctly, you shouldn't have any problems. The most important thing to keep in mind when using the position property is that it's all about context. Positioning elements absolutely, for example, means that:
- those elements are removed from the normal flow of the document
- any offsets declared on those elements - top, right, bottom or left - will use the nearest relatively-positioned parent element as their context
I will say that it's unusual to be positioning all of your images and text with position: absolute; so it may be worth learning more about the property and considering a more efficient alternative before diving into making your site responsive.
Jacob Thomson
757 PointsJacob Thomson
757 PointsThanks a lot for your advice, what is the more efficient way to get certain images and text sitting in different places all over your site, the only downside i have noticed, is when i go to resize my browser, all the stuff that has been styled with absoloute, will stay in the same place and eventually disappear as the window gets towards a mobile width. Can media queries change that affect? Nick Pfisterer