思路:先画出4个U形,将它们2D旋转排列,在另外建两个Div,给他们设置CSS属性,使边框达到半圆半直角,在与U形连接,用一个DIV盒子装起来,旋转45度;
参考代码:
<style type="text/css">
#p2{
transform: rotate(-45deg);
}
#dU1,#dU2,#dU3,#dU4{
width: 155px;
height: 50px;
border-style: solid;
border-width: 5px;
border-color: red;
border-radius: 0 50px 50px 0;
border-left:none ;
position: absolute;
}
#dU1{
top: 200px;
left: 200px;
}
#dU2{
transform: rotate(180deg);
top: 255px;
left: 155px;
}
#dU3{
transform: rotate(90deg);
left: 145px;
top: 250px;
}
#dU4{
transform: rotate(-90deg);
top: 200px;
left: 200px;
}
#dO1,#dO2{
width: 40px;
height: 40px;
border: #FF0000 5px solid;
position: absolute;
}
#dO1{
left: 150px;
top: 155px;
border-radius: 50px 50px 0px 50px;
}
#dO2{
left: 305px;
top: 310px;
border-radius: 0px 50px 50px 50px;
}
</style>
<body>
<div id="p2">
<div id="dU1">
</div>
<div id="dU2">
</div>
<div id="dU3">
</div>
<div id="dU4">
</div>
<div id="dO1">
</div>
<div id="dO2">
</div>
</div>
</body>