Forum Moderators: not2easy
I have a div for which I cannot set a width value since its content is dynamic. Furthermore I need to position this div relative to other elements of the page.
div#poem {
background-color:#CC33FF;
position: relative;
}
My problem is that the background color of this div is not limited to the area covered by the text, but runs all the way to the right hand side of the page.
----------------------------------------------------------------------------------
¦Dynamic text:
¦I don't know
¦how large it is!
----------------------------------------------------------------------------------
If I use 'position:absolute' the background will be nicely contained, but the div will interfere with other elements positioned on the page.
So, my questions is: how can I have a contained background and border for a div while positioning it relatively?
-----------------
¦Dynamic text:
¦I don't know
¦how large it is!
-----------------
I hope you can help.