Reputation: 569
I have an element that I moved right and then pushed up on top. It's lined up perfectly, but for some reason it still leaves the space it previously occupied below it. I tried clear, overflow, whitespace, negative-margins, visibility, block, etc. No joy. CSS doesn't seem to anticipate human thought.
div.overlay-ad{
position:relative;
width:310px;
height:260px;
top:-332px;
left:538px;
}
Upvotes: 0
Views: 150
Reputation: 4356
div.overlay-ad{
position:absolute;
width:310px;
height:260px;
top:-332px;
left:538px;
}
The position: relative
makes your block take up space in the flow. It doesn't matter that the visual rendering is then positioned away. position: absolute
moves the block out of the general flow.
Upvotes: 1