Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

box-shadow on img in CSS

Tags:

css

image

Is it possible to add a shadow to the img tag in CSS, I tried and it doesn't seems to work. Am I correct or my code is just messed up

CSS

.image_carousel img {
  padding-right: 14px;
  display: block;
  float: left;
  box-shadow: 3px 3px 1px #ccc;
  -webkit-box-shadow: 3px 3px 1px #ccc;
  -moz-box-shadow: 3px 3px 1px #ccc;
}

HTML

<div class="image_carousel"><img src="../imgs/image.jpg" width="800" height="600" alt=""/></div>
like image 351
Warface Avatar asked Feb 02 '23 15:02

Warface


1 Answers

looks like you can:

.image_carousel img {
  margin-right: 14px;
  display: block;
  float: left;
  box-shadow: 3px 3px 1px #ccc;
  -webkit-box-shadow: 3px 3px 1px #ccc;
  -moz-box-shadow: 3px 3px 1px #ccc;
}
<div class="image_carousel"><img src="//placehold.it/300/f80/fff" alt=""/></div>
like image 70
Joseph Marikle Avatar answered Feb 05 '23 05:02

Joseph Marikle