0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【初心者でもわかる】CSSで水滴を再現

Posted at

#どうも7noteです。大きさも自由に変更可能な水滴をCSSで再現。

sample.png

ソース

index.html
<div class="drop"></div>
style.css
.drop {
  width: 100px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(transparent 30%, #CDCDCD 80%);
  box-shadow: 2px 2px 2px #737373;
  position: relative;
}
.drop::before {
  content: '';
  width: 15%;
  height: 15%;
  background: radial-gradient(rgba(255,255,255,0.8) 50%, transparent);
  border-radius: 50%;
  display: inline-block;
  position: absolute;
  top: 10%;
  left: 25%;
}

sample.png

widthとheightの大きさを変えれば様々な大きさの水滴が作れます。

スクリーンショット 2021-05-23 11.38.41.png
スクリーンショット 2021-05-23 11.37.52.png

おそまつ!

~ Qiitaで毎日投稿中!! ~
【初心者向け】WEB制作のちょいテク詰め合わせ

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?