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
Peter Zee
12,417 PointsAbsolute positioning and floats
I understand the video but I still wonder whether abs. pos. affects or get affected by floating elements.
Floats are not in the normal flow of the page and in the teachers note I saw this line explicitly naming "other elements in the normal flow of the page":
Elements with absolute positioning are neither affected by or do not affect other elements in the normal flow of the page.
2 Answers
Aaron Loften
12,864 PointsThis is a little confusing, but I think I can try to help.
Im going to try to answer this with two scenarios, as it is not clear to me what you are wanting to know.
If you were to absolute position a parent div and the float a child div, it would float it within the parent, and would be relevant toward the parent. eg: in this example, a float right is turned into a float "bottom"(which doesnt exist)... Click Here
The other scenario that I think you're speaking of....
If you were to have two elements, one being an absolute positioned element and the other is a flaoted element, they do not interfere with each other... eg: Click Here
Maxwell DeMers
6,853 PointsIf I understand what you are asking, no, absolute positions aren't affected by floats. As mentioned above, the set up of your HTML can drastically affect the way a float will behave, depending on the parent/child set up you have.