Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Picture html alignment?

First off i dont know much about html codes so bare with me but how can I add a photo to an html code but make the imagine float? Or move the image where i want it by using pixels? Ive done it before but that was 3 years ago lol. Says something like "top: 30px, left: 100px" and so on, and I was able to move a photo anywhere how can i do this?

2 Answers

Relevance
  • 6 years ago

    You can do it with position: relative. After giving it a position relative, you can use the top, bottom, left, right rules. With its natural position, which is static, you can't use those rules. If you use position absolute, the image will not care about the rest of the content, it will be placed as you want, but it will hide normal content behind it.

    By the way, position relative is RELATIVE to the parent div/element. So if you say "position: relative; top: 1px; left: 1px;", that just means that from the border-top of the parent element and from the border-left of the parent element, it should be moved 1 pixel. Of course, box-sizing must be border-box.

  • 6 years ago

    This SHOULD work:

    <img src="image.png" style="z-index:999; position:absolute;top:50px;left:50px;"/>

    Change the top:50px; and left:50px;

Still have questions? Get your answers by asking now.