簡體   English   中英

在非矩形的div中添加盒形陰影(使用邊框半徑)

[英]Adding box-shadow to a not-rectangle shaped div (playing with border-radius)

是否可以為非規則矩形的div添加均勻陰影? 添加box-shadow不適用於普通div。 這是我正在談論的div:

#talkbubble {
   width: 120px;
   height: 80px;
   background: red;
   position: relative;
   -moz-border-radius:    10px;
   -webkit-border-radius: 10px;
   border-radius:         10px;
}
#talkbubble:before {
   content:"";
   position: absolute;
   right: 100%;
   top: 26px;
   width: 0;
   height: 0;
   border-top: 13px solid transparent;
   border-right: 26px solid red;
   border-bottom: 13px solid transparent;
}

是的你可以。 這是示例:

 .circle { width:150px; height:150px; border: solid 1px #555; background-color: #eed; box-shadow: 10px -10px rgba(0,0,0,0.6); -moz-box-shadow: 10px -10px rgba(0,0,0,0.6); -webkit-box-shadow: 10px -10px rgba(0,0,0,0.6); -o-box-shadow: 10px -10px rgba(0,0,0,0.6); border-radius:100px; } 
 <div class="circle"> </div> 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM