A
A
Azat S.2015-09-20 19:00:32
css
Azat S., 2015-09-20 19:00:32

How to make an inner shadow for a small image without specifying its size?

Tell me how to darken a small image around the edges.
With absolute positioning, the box-shadow stretches to fit the width of the screen and doesn't look great:
codepen.io/anon/pen/zvBqXv

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Azat S., 2015-09-20
@azat-io

Found a solution.
You need to add display: inline-block; to the img selector.

T
Therapyx, 2015-09-20
@Therapyx

Add to .img {
position: relative;
width:200px;
}
codepen.io/anon/pen/KdMzjL
?
Or do you need to darken the image itself? )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question