svg viewBox
时间: 2023-08-26 07:10:55 浏览: 108
回答: SVG的viewBox属性用于定义SVG元素的可见区域和坐标系。它是一个矩形框,由四个值组成,分别表示x、y、width和height。\[1\]在引用\[1\]中的例子中,viewBox的值是"0 0 200 200",表示可见区域的左上角坐标为(0, 0),宽度为200,高度为200。而在引用\[2\]中的例子中,viewBox的值是"105 55 60 60",表示可见区域的左上角坐标为(105, 55),宽度为60,高度为60。\[2\]在使用viewBox属性时,需要设置四个值,分别表示可见区域的左上角坐标和宽度、高度。例如,<svg width="200" height="200" viewbox="0 0 100 100"></svg>中的viewBox属性值是"0 0 100 100",表示可见区域的左上角坐标为(0, 0),宽度为100,高度为100。\[3\]
#### 引用[.reference_title]
- *1* *3* [svg之ViewBox详解,秒懂SVG里的viewbox](https://blog.csdn.net/zp19860529/article/details/114173594)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [svg中viewbox图解分析](https://blog.csdn.net/Kiruthika/article/details/124974340)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]