tags:

views:

94

answers:

3

Hi,

I know "position: absolute" will pop an element from the "flow of HTML/CSS" and it stops interacting with its neighbors. What other ways are there to achieve this?

+1  A: 

There's display: none, but I think that might be a bit more than what you're looking for.

Greg Hewgill
But even then, it's still "in the neighborhood".. absolute position relative to the body is the only way to have full control over it's position. Keep in mind if it's parent is declared as relative then it's absolute origin is relative to that - you'd have to append the element to document.body or non-relatative declared element in that case.
Dan Heberden
What? Position is not relevant if the element isn't even *displayed*.
Greg Hewgill
+1  A: 

None?

I mean, other than removing it from the layout entirely with display: none, I'm pretty sure that's it.

Are you facing a particular situation in which position: absolute is not a viable solution?

Matchu
+1  A: 

Floating it will reorganise the flow but position: absolute is the only way to completely remove it from the flow of the document.

Sam Bowler