4 ms·
Why would one use CSS over SVG for this?
by grizzles 12y ago
Why would one use CSS over SVG for this?
- pkulak 12y agoBecause it's for laying out text, not creating images.
- pimlottc 12y agoIt seems though that many (most?) use cases would be solved if image formats supported non-rectangular bounding, er, "boxes". Seems like something that could potentially be added to SVG.
- sambeau 12y agoIf you look at the Alice demo, linked, it shows that it can also be used to creatively shape text layouts and animate them over time. https://www.youtube.com/watch?v=VON2shFlsKU https://www.youtube.com/watch?v=VON2shFlsKU
- fenomas 12y agoThe shape is being used to style an HTML element; naturally you use CSS for that. But if you're asking why the shape is being defined with text, inline in the CSS, that's because defining shapes with SVG was postponed to level 2 of the CSS Shapes spec. http://dev.w3.org/csswg/css-shapes-2/#referencing-svg-shapes http://dev.w3.org/csswg/css-shapes-2/#referencing-svg-shapes
- untog 12y agoThe only way to use SVG for this would be to include the text in the SVG. SVG's text handling is awful, and doesn't have concept of reflowing according to size, so it would ultimately be a terrible solution.