有一對夫婦的方式去做。我只是簡單地把方形div放在一個更大的容器div中,然後如你所願地設計它。我已經包含了幾個例子給你。
我希望這有助於! - 詹姆士。
.square {
width: 20px;
height: 20px;
display: block;
position: relative;
background: #fff;
opacity: 1;
margin: 5px 0 0 5px;
}
.circle,.circle-with-spread {
display: block;
background-color: #000;
opacity: 0.3;
width: 30px;
height: 30px;
border-radius: 15px;
position: absolute;
}
.circle-with-spread {
box-shadow: 0 0 5px 5px rgba(0,0,0,1);
}
<!-- Example Circle Shadow -->
<div class="circle">
<div class="square"></div>
</div>
<!-- Spacing makes it look nice -->
<br />
<br />
<br />
<!-- Second Example -->
<div class="circle-with-spread">
<div class="square"></div>
</div>
我有一個很難想象這...這看起來像一個圓圈包圍的正方形/長方形?有兩個div,一個外部透明背景呢? – JCOC611
你能分享你需要的圖片嗎?這有點令人困惑 –