解释适用于SVG元素的CSS'display'属性? [英] Explain CSS 'display' property applied to SVG elements?

查看:135
本文介绍了解释适用于SVG元素的CSS'display'属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据规范引入SVG需要将新值添加到CSS显示属性:svg.SVG中的元素具有默认样式:

According to the spec the introduction of SVG required a new value to be added to the CSS display property: svg. And elements within an SVG have the default styling:

svg { display: block; overflow: hidden }
svg * { display: svg } 

那是有道理的.包含SVG的SVG元素被设置为该块,并且SVG元素中包含的每个元素都将显示:svg.这只是意味着将这个SVG元素传递给要渲染的SVG引擎,但是如果您将SVG文档中的元素设置为其他值(内联,块等),该元素会发生什么呢?规范没有解释这会做什么,甚至没有意思.

That makes sense. The SVG element which contains SVG is set to the block, and every element contained within an SVG element is display: svg. It simply means pass this SVG element to the SVG engine to be rendered, but what happens to that element if you set an element inside an SVG document to some other value (inline, block, etc)? The spec doesn't explain what that would do or even mean.

推荐答案

该规范没有解释这将做什么甚至是什么意思.

The spec doesn't explain what that would do or even mean.

的确如此,并且进一步看来,在规范的修订版发布之后,它被完全注销了.在 svg 不再是 display 的有效值rel ="noreferrer"> 2001年的SVG 1.0建议,或 SVG1.1 .这很可能意味着您从未提到过类似情况下的行为.

Indeed, and further to that it looks like it was written off completely after that revision of the spec was published. svg is no longer a valid value for display in either the 2001 recommendation of SVG 1.0, or SVG 1.1. This may very well mean that behavior in situations like the one you've mentioned was never defined.

这篇关于解释适用于SVG元素的CSS'display'属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆