是否有可能以某种方式将 html 框模型属性应用于 SVG 中的基本形状元素?例如申请 margin
至 <rect>
元素。我找到了不可能的解释:
The display, float and flow properties and all margin, padding, border and background properties can be applied to the top-level svg element but not to child elements within it.
但也许有一些技术可以让它成为可能?我想创建 <rect>
带边距的元素。
最佳答案
svg 中没有流布局,因此边距的概念必须用绝对术语来完成(阅读:手动)。
更详细地解释您的用例?
关于svg - SVG 元素的盒模型属性(边距、填充)。他们得到支持吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12041403/