user1856596
user1856596

Reputation: 7233

Moving a div leaves a space where the original position was?

I have a div, which I move like this:

.x .y {
    position: relative;
    top: 163px;
}

Now that leaves a space at the size of the div where it was placed originally. Is there a way to get rid of that space?

Thanks!

Upvotes: 1

Views: 1249

Answers (2)

David Gras
David Gras

Reputation: 1028

I guess position: absolute is not an option in most of cases.

Try to make it float!

Upvotes: 0

JCBiggar
JCBiggar

Reputation: 2497

Use position: absolute; instead of position:relative;... and then instead top:163px; use margin-top: 163px;

UPDATE You can use also, top: 163px; depending on what you are using it for.

Upvotes: 1

Related Questions