Gabe462
Member
Posted 2 years ago #
I'm trying to keep an H1 element positioned absolutely within its parent element, but it's acting like it thinks its parent is <body>.
Here's a link, what's up with the "latest news"? change the window width to see.
http://686.circuittree.net/test/index1.html
G462
Hi
You have to assign position:relative to the parent element. Then it will behave as you want.
When there is no position relative assignment in any of its containing blocks, the page element sets its absolute positioning relative to the body tag.
Gabe462
Member
Posted 2 years ago #
Ah, that was simple. Thanks very much for your help!
I also was having the same problem, and found this thread very helpful. Thanks!