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!

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 Positioning Elements Relative to Other Elements

Is it fair to say that 'position' tags are a more free 'float' type of tag?

To get things into more simple terms in my mind, is it fair to say that the 'position' tag is a more "free" version of the 'float' tag?

grant Mitchell
grant Mitchell
6,919 Points

more absolute than float, float is old, never use it.

1 Answer

Steven Parker
Steven Parker
228,001 Points

First, I think we're discussing properties not "tags". And a "float" always removes the element from the normal document flow, but if "position" is set to "relative" the normal flow is still observed. You can use offset values to cause the element to display in a different place, but the space taken up in the normal document flow remains the same.

On the other hand, "absolute" and "fixed" do remove an element from the normal flow, but you must explicitly specify where it should be shown, unlike how floats arrange things for you relative to where they would have been otherwise.

Though I would not say "never", grant has a good point. If you're thinking about using a float you might want to consider one of the newer methods such as "flexbox" or "grid" instead.

Thank you! I'm on my way to learn flexbox and grid as we speak, thanks a lot!