请马上登录,朋友们都在花潮里等着你哦:)
您需要 登录 才可以下载或查看,没有账号?立即注册
x
<style>
.pa {
width: 400px;
min-width: 200px;
height: auto;
aspect-ratio: 2/1; /* 保持2:1宽高比 */
border: 1px solid gray;
overflow: hidden; /* 拖曳改变元素尺寸支持 */
resize: horizontal; /* 横向拖曳 */
margin: 30px auto 0;
}
</style>
<div class="pa">
<svg width="100%" height="100%" viewBox="0 0 100 50">
<!-- 路径 :设置为描边不缩放 -->
<path
d="M 2 25 A1 0.4,0 0 0, 98 25"
fill="none"
stroke="red"
stroke-width="2"
vector-effect="non-scaling-stroke"
/>
<!-- 圆 :不禁止描边缩放(缺省默认) -->
<circle
cx="10"
cy="10"
r="5"
fill="lightgreen"
stroke="orange"
stroke-width="1"
/>
<!--矩形 :描边不缩放 -->
<rect
x="50"
y="25"
width="10"
height="10"
fill="tan"
stroke="red"
stroke-width="4"
vector-effect="non-scaling-stroke"
>
<animateTransform
attributeName="transform"
type="rotate"
from="0 55 30"
to="360 55 30"
dur="8s"
vector-effect="non-rotation"
repeatCount="indefinite"
/>
</rect>
</svg>
</div>
|