• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

CSS positioning question

ElDonAntonio

Senior member
I'm rather new to using CSS to completely design my web pages.

I have various elements (text, images) inside a div. I'm using relative positioning to shift some of these elements up (for example, shifting up text to overlay it over an image). It all works very nicely, but the containing div takes up as much space as it would if I had not shifted up my elements. So I end up with empty space at the bottom for nothing.

Anyone knows how to fix this?
 
What is it, exactly, you're trying to do?

From your description, what I would do is to make the image the "background" of the DIV and then you'll be able to position whatever text over it you'll need.

But, really, without more information, your post could mean almost anything.
 
Absolute positioning will probably work better for you as it doesn't leave the space where the item used to be before it was moved. Set the containing div to position relative, then the children as absolute.
 
I'm with drebo in that it sounds as if the image would best be used as a background since the text is overlaying it.
 
Back
Top