B.Gh B.Gh - 1 year ago 91
HTML Question

How to move an image upwards in html/css

I'm quite new to HTML and I wanted to have an image in my page, but when I use

to separate it from other stuff they cross each other. So I want to move my image up a little. Here's the code I've been using:

<html dir="rtl"> <body> ... <img src="20161125_041749.jpg" alt="my pic" style= "width: 108px; height: 130px; float:left;" ... </div> </body> </html>

I'm not using

I've been trying to use position:relative;top:-10px; ,but I can't figure out how to use it or it has some problem with the "float".
Coud anyone please help me what to do?

Thanks in advance and Thanks to all who have tried to solve it so far...

Answer Source

change the value of top as you needed

  position: relative;
<img src="https://i.stack.imgur.com/W1bSf.jpg" alt="my pic" style= "width: 108px; height: 130px; float:left;" id="img">

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download