user5447339 user5447339 - 1 year ago 77
CSS Question

move an image towards the top in css

I have a fiddle in which I want to move an image (keyboard) towards the top so that it looks exactly similar to below design.

enter image description here

In my fiddle, the keyboard image is slightly down as depicted in the fiddle. I am wondering how can I push my keyboard image slightly up so that it looks exactly similar to the above design.

The snippets of my HTML code having keyboard image are :

<div class="full-stack-developer">
<div class="container">
<div class="row justify-content-center">
<div class="col-lg-3 left-side">
<a href=""><img src="assets/img/Uploads/keyboard.png" </a></div>
<div class="col-lg-3 right-side"> <a href="">Full Stack Developer</a>
<a href=''>
<a href=''>
<li>Go here</li>

Just checking if it can be done without using
position: relative and position: absolute

Answer Source

You can add the margin top -50px to the image.

#id_keyboard {
    margin-top: -50px;

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