The answer of @TheMaleBeyonce is right. with your current layout, you should make sure this div element is just used to surround the outer image, and make sure the width of the div is equal to the outer image.
Suppose the width of outer image is 200px, the right code as below:
So, what I would do is set the div to position:relative; and the 2nd image to position:absolute; right:0; top:0;. Assuming image 1 is as big as the div, this will make the second images position relative to the first image, so then you just position it where you like then set the width/height
Solution 3 :
To achieve this you need to give position: relative to the parent element, in this case: to the wrapper div. Then set position: absolute to your small image. Make sure you set width: 100% to your big image.
What I was trying to accomplish was that the second link element, which contains an image, to be in the top right of the first image. However, the smaller image stays on the outside of the other one. Is there any possible way this could be done with the same layout? If not, then please tell me how I could make it work.
Comments
Comment posted by Sydney Y
I think they’d actually need to assign positions to the parent
Comment posted by Rico
.big-img { position: relative; }
Comment posted by Robin
In this case its not needed, But its safe to use, if he wrap the