Is there a way to dephase the border of a div?

492 views html
9

I'm trying to achieve this design in which every div of certain class of my site shows the border kind of dephased from the actual content of that div as seen in the image (link below). Is there a way to achieve this with css?

answered question

What have you tried? Can you show us your html markup code?

1 Answer

13

If you know the height and width, you can try this: http://jsfiddle.net/9yvd68az/

HTML:

<div class="img-container">
  <img src="https://i.imgur.com/uj0yKZZ.png"/>
</div>

CSS:

.img-container{
  display: inline-block;
  border: 2px solid blue;
  height: 220px;
  width: 220px;
}

.img-container img{
  margin-left: 5px;
  margin-top: 5px;
}

posted this

Have an answer?

JD

Please login first before posting an answer.

Ads

Categories