【发布时间】:2016-08-24 23:38:03
【问题描述】:
我正在尝试创建一个旋转椭圆( 不管rotateX如何,它可能是具有相同宽度的边框?谢谢你的回答。 编辑:
GCyrillus,我也想过类似的事情,但是我不能手动写border-width的值。椭圆使用 JavaScript 进行线性旋转: 【问题讨论】:window.onload = function() {
var ellipse = document.getElementById('ellipse');
var angle = 0;
setInterval(function() {
angle++;
ellipse.style.transform = 'rotateX(' + angle + 'deg)';
}, 20);
};section {
perspective: 1000px;
}
#ellipse {
border: 1px solid black;
border-radius: 100%;
height: 300px;
margin-bottom: 20px;
position: relative;
width: 500px;
}<section>
<div id="ellipse"></div>
<section>
标签: javascript css css-transforms