Knriano Knriano - 1 year ago 56
CSS Question

Place an image in the left corner of border

My problem is very simple, I want to place a small image in the corner left of my border as shown in the example below.

enter image description here

My code



.description{
border: 1px dotted black;
position: relative;
}

.img-description{
position: absolute;
top: 0;
left: 0;
}

p{
padding: 20px;
}

<div class="col-md-4 description">
<img src="http://i.imgur.com/m8s1L6J.png" class="img-description"/>
<p>Some text...</p>
</div>





Do you know how I could achieve this?

Thanks for your help.

Answer Source

If you already have this code

.img-description{
  position: absolute;
  top: 0;
  left: 0;
}

You can update your top and left values to fit your idea. For example:

.img-description{
  position: absolute;
  top: -10px;
  left: -10px;
}
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download