gpt4 book ai didi

html - 当涉及边距时,如何确定 的宽度?

转载 作者:可可西里 更新时间:2023-11-01 12:49:19 25 4
gpt4 key购买 nike

好像是 <svg> 的宽度元素根据父元素的大小设置,但忽略边距:

enter image description here

这是为什么?我怎样才能制作一个 <svg>表现得像其他人一样 block尺寸时的元素?

fiddle :http://jsfiddle.net/4p3ww/

最佳答案

There is no way for some SVG content to say it wants to take up whatever space is available after borders, padding and margins have taken their share (there is no way to create SVG that does NOT have an intrinsic width/height since the 'width' and 'height' attributes default to 100%).

https://wiki.mozilla.org/SVG:Sizing

关于不同的浏览器应该如何呈现这些内容,似乎仍有争论,所以我会小心。即使有高度/宽度属性和 max-width CSS,它对我来说仍然显得很奇怪。

http://jsfiddle.net/4p3ww/3/

关于html - 当涉及边距时,如何确定 <svg> 的宽度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18950867/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com