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
Ben Os
20,008 Pointsposition: absolute takes the <p> element one row down
Please have a look at the following code pen:
http://codepen.io/anon/pen/ZWXejX
If you'll delete the position: absolute property for the <p> element, you will notice this tag going one row up. Why is this happening?
1 Answer
Steven Parker
243,656 PointsNormally (without position) it is inside the div.
But when it's positioned absolute, it's not part of the normal document flow, and is placed after the div by default (and therefore a bit lower). However, you can now put it anywhere you want by specifying top or bottom.
Jack Smith
6,902 PointsJack Smith
6,902 Pointsdisplay inline block