Hot to set image to the top right corner of container?

Hello. Please help me. I need to set image to the top right corner of container. When I try to set “Float: Right” headings is move to left. How can do it without moving headings?

https://dl.dropboxusercontent.com/s/zvclduzqfrj8slg/Screenshot%202015-05-15%2013.37.34.png?dl=0

Also, when I try to set image to absolute it is positioned relative to whole browser window instead of container.

Only use float when the soldiers are at your door :wink:

Here you don’t need float, it’s not made for that.

You need ABSOLUTE position, top right. An absolute positioned element will be positionned regarding it’s CLOSETS POSITIONNED PARENT.

So

  1. start by giving the parent, the container, position:relative. it changes nothing but now it’s “positionned”
  2. give your corner element position:absolute and click to upper right corner button.

Now it should stick on that corner like a superglued-on-the-ceiling salaryman

2 Likes

Got it! I forget about position:relative for container. Thanks a lot!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.