I am struggling with a problem. I have to put the border of the element inside the image (I can’t put the image because of a reputation of less than 10), but this border should have the same width and height of this element. He must be responsive. I write code based on bootstrap media resolution resolution, but when I reduce my page, it becomes small at a certain screen resolution. This is the code. Thank.
<div class="parent">
<img />
<span class="makeBorder"></span>
</div>
and css:
.parent {
position: relative;
}
.makeBorder {
position: absolute;
top: 15px;
left: 23px;
border: 2px solid red;
width: 83%;
height: 83%;
}
What am I finally doing:
<div class="customClass"><img /></div>
.customClass{outline:1px solid red;outline-offset:-18px;}
source
share