Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Explain CSS 'display' property applied to SVG elements?

Tags:

css

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 } 

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.

like image 334
chubbsondubs Avatar asked Sep 05 '25 03:09

chubbsondubs


1 Answers

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

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.

like image 101
BoltClock Avatar answered Sep 07 '25 20:09

BoltClock