智能客服
你问我答,随时在线为你解决问题

























svg组件可以用来绘制常见图形和线段,如矩形(<rect>)、圆形(<circle>)、线条(<line>)等,具体支持图形样式还请参考svg组件。
在本场景中,绘制各种图形拼接成一个小房子。
- <!-- xxx.hml -->
- <div class="container">
- <svg width="1000" height="1000">
- <polygon points="100,400 300,200 500,400" fill="red"></polygon> //屋顶
- <polygon points="375,275 375,225 425,225 425,325" fill="orange"></polygon> //烟囱
- <rect width="300" height="300" x="150" y="400" fill="orange"> //房子
- </rect>
- <rect width="100" height="100" x="180" y="450" fill="white"> //窗户
- </rect>
- <line x1="180" x2="280" y1="500" y2="500" stroke-width="4" fill="white" stroke="black"></line> //窗框
- <line x1="230" x2="230" y1="450" y2="550" stroke-width="4" fill="white" stroke="black"></line> //窗框
- <polygon points="325,700 325,550 400,550 400,700" fill="red"></polygon> //门
- <circle cx="380" cy="625" r="20" fill="black"></circle> //门把手
- </svg>
- </div>
- /* xxx.css */
- .container {
- width: 100%;
- height: 100%;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- background-color: #F1F3F5;
- }

智能客服
你问我答,随时在线为你解决问题
合作咨询
我们的专家服务团队将竭诚为您提供专业的合作咨询服务
解决方案
精准高效的一站式服务支持,助力开发者商业成功