6
7

More than 5 years have passed since last update.

CSS 要素の上に霧を被せる

Posted at

sampleGif.gif

html


<div><img src="sample.JPG"></div>

CSS


div{
  width: 300px;
  height: 300px;

   /* 霧 */
  box-shadow:
    -100px -100px 500px 0 #eee inset,
     100px  100px 500px 0 #eee inset;

  transition: 3s;
}

div img{ 
  width: 300px;
  height: 300px;
  position: relative;
  z-index: -1;
}

div:hover{
  box-shadow: none;
}


6
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
7