I'm experimenting with absolute position in CSS and have created the following example:
As you can see in desktop-view the handbag is hanging from the pipe. My problem
is that if I reduce the browser width, the position of the handbag changes, so that it comes bellow the pipe.
What should I change that the bag is always hanging form the pipe and doesn't change it's position?
You need to create a positioning context. As it is now the images are positioned relative the viewport. You do that by giving a containing element position: relative. #wrapper works fine. This doesn't change anything with #wrapper, more than that boxes it contains can be positioned relative its edges.
The percentages for the bag seems to be off too, especially when the code is taken out of the codepen context. I didn't calculate the numbers, just trial and error. I'm lazy. Hope I got it right.
Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)