次のようなツールチップを作成する方法を知っています。
div{
width: 200px;
height: 200px;
background: red;
margin: 80px;
border-radius: 20px;
position: relative;
box-shadow: inset 2px 2px 15px black; //this is the problem
}
div:before{
content: ' ';
display:block;
width: 0;
border-left: red 30px solid;
border-right: transparent 30px solid;
border-bottom: transparent 30px solid;
border-top: transparent 30px solid;
position:absolute;
top: 60px; right: -60px;
}
上記のコードは、divの内部シャドウを設定しますが、sudo要素の内部シャドウは設定しません。これがデモです。sudo要素の境界で内側の影を機能させる方法はありますか?または、必要な効果を得る別の方法はありますか。
ドロップシャドウが必要な場合は、divにフィルターを適用できることを知っています。
filter: drop-shadow(2px 2px 15px black);
しかし、内側の影のためにそれを行う方法はありますか?
ありがとう