W
W
webhero2018-05-26 13:38:58
css
webhero, 2018-05-26 13:38:58

What is the best way to implement such an element?

I mean the frame of the image
5b09392a14d79502158045.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
O
overveg, 2018-05-27
@webhero

Option using box-shadow:

box-shadow: 10px -10px 0px 0 white,
    10px -10px 0px 1px teal;

With this implementation, you can do without unnecessary wrappers and the use of pseudo-elements
Example on codepen

H
HamSter, 2018-05-26
@HamSter007

Alternatively, you can use an image wrapper + pseudo -elements :beforeand :after.
The shift can be adjusted either topand leftor translate(X,Y).
jsbin example

D
Dmitry, 2018-05-26
@2fox

make a frame for the parent img tag
, for example, for span, and shift the image itself to position: relative

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question