[英]White border on overlap CSS
Can this be created using CSS : 可以使用CSS创建吗?
I have tried using PNG images : 我尝试使用PNG图片:
.x { position:relative; top: 100px; left: 0px; height: 120px; width: 300px; display: block; } .y { position:relative; top: -20px; left: 0px; height: 120px; width: 300px; display: block; transform: rotate(60deg); } .z { position:relative; top: -140px; left: 0px; height: 120px; width: 300px; display: block; transform:rotate(-60deg) }
<img class="x" src="http://i.stack.imgur.com/Qf8Ot.png"> <img class="y" src="http://i.stack.imgur.com/Qf8Ot.png"> <img class="z" src="http://i.stack.imgur.com/Qf8Ot.png">
But I wanted overlap to be white as the first image. 但是我希望重叠部分是白色的,作为第一张图像。 Any clues?
有什么线索吗? Thank you very much.
非常感谢你。
Create ellipses using border-radius
. 使用
border-radius
创建椭圆。
Add box-shadow
to them : 给他们添加
box-shadow
:
#a, #a:before, #a:after { height:80px; width: 300px; background: transparent; border-radius: 50%; border: 5px solid black; transform: rotate(30deg); } #a { position: relative; top:100px; } #a:before, #a:after { position: absolute; content: ""; box-shadow:inset 0 0 0 4px white, 0 0 0 4px white; } #a:before { transform: rotate(60deg); } #a:after { transform: rotate(120deg); }
<div id="a"></div>
You should use box-shadow. 您应该使用盒子阴影。 Make the color of shadow white.
使阴影颜色为白色。
Use inset shadow also, it will make shadow inside the image. 也使用插入阴影,它将在图像内部产生阴影。
box-shadow :inset 0 0 5px #FFF, 0 0 5px #FFF ;
use -webkit-, -moz- , -o- according to your browser requirments. 根据您的浏览器要求使用-webkit-,-moz-,-o-。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.