<head>
<meta charset="UTF-8"/>
<title>端午节快乐</title>
</head>
<style type="text/css">
*{margin: 0padding: 0}
div{width: 400pxheight: 400px color: red border: 5px cornflowerblue solidposition: fixedtop: 0overflow: hiddenborder-radius:50% column-count:6 column-gap: 30px
-webkit-column-gap:30px-webkit-column-count:6 font-size: 2em}
#a{color: chartreuse}
#b{ transform:rotate(45deg) -webkit-transform: rotate(45deg)}
#c{width:300pxheight: 300pxbackground:redborder-radius:50%position: fixedtop:50px left: 50px}
span{width:1pxheight:300pxposition: absolutetop:0left:150pxbackground:navajowhite}
.a{transform:rotate(60deg)-webkit-transform: rotate(60deg)background:darkmagenta}
.b{transform:rotate(90deg)-webkit-transform: rotate(90deg)background:turquoise}
.c{transform:rotate(120deg)-webkit-transform: rotate(120deg)background: yellow}
.d{transform:rotate(150deg)-webkit-transform: rotate(150deg)background: mistyrose}
.e{transform:rotate(180deg)-webkit-transform: rotate(180deg)background: greenyellow}
.f{transform:rotate(30deg)-webkit-transform: rotate(30deg)background:blue}
</style>
<body>
<div id="a" class="div">
端午节快乐端午节快乐端午节 快乐端午节快乐端午节快乐端午节快乐端午节快乐端午节快乐端午节 快乐端午节快乐端午节快乐端午节快乐
</div>
<div id="b" class="div">
端午节快乐端午节快乐端午节快乐端午节快乐端午节快乐端午节快乐端午节快乐端午节快乐端午节快乐端午节快乐端午节快乐端午节快乐
</div>
<div id="c">
<span class="a"></span>
<span class="b"></span>
<span class="c"></span>
<span class="d"></span>
<span class="e"></span>
<span class="f"></span>
</div>
</body>
</html>
可以呀。
<!DOCTYPE html><html lang="en">
<head>
<meta charset="UTF-8">
<title>css 12等分圆</title>
</head>
<style type="text/css">
.container {
position: relative
width: 200px
height: 200px
overflow: hidden
border: 2px outset deeppink
border-radius: 50%
margin:5em auto
}
.layer {
position: absolute
transform-origin: left top
left: 100px
top: 100px
width: 100px
height: 100px
border: 1px solid white
box-sizing: border-box
}
</style>
<script type="text/javascript">
onload = function () {
[].slice.call(document.querySelectorAll('.layer'), 0).forEach(function (item, i) {
item.style.backgroundColor = '#' + (~~(Math.random() * (1 << 24))).toString(16)
item.style.transform = 'rotate(' + 360 / 12 * (i + 1) + 'deg)skewX(60deg)'
})
}
</script>
<body>
<div class="container">
<div class="layer"></div>
<div class="layer"></div>
<div class="layer"></div>
<div class="layer"></div>
<div class="layer"></div>
<div class="layer"></div>
<div class="layer"></div>
<div class="layer"></div>
<div class="layer"></div>
<div class="layer"></div>
<div class="layer"></div>
<div class="layer"></div>
</div>
</body>
</html>
<div style="width:100pxheight:100pxborder-radius:50%overflow:hidden"><img src="">
</div>
需要浏览器支持CSS 3 ,注意div的宽高要一样,也可以直接把样式添加在img上,但不建议那样