如果您以非语义方式使用 div-soup 和 CSS 来创建视觉图片,将其全部包装在 <figure>
中是否有意义?元素来指示内容是非语义的?
更多信息:我正在使用一组具有内联样式的嵌套 DIV 和 SPAN 来绘制条形图。 (我知道 SVG 是一种更好的方法,但是按照我的设计要求使 SVG 响应基于百分比的尺寸是不可行的。)另外,我还制作了图表的屏幕阅读器可访问的文本摘要.但我不希望屏幕阅读器在视觉版本上出错。
最佳答案
我会说这是对 figure
的可接受使用。
The figure element represents some flow content, optionally with a caption, that is self-contained (like a complete sentence) and is typically referenced as a single unit from the main flow of the document.
The element can thus be used to annotate illustrations, diagrams, photos, code listings, etc.
<子> Source , 强调我的
将 img
的 ARIA Angular 色添加到 figure
可能会进一步改进标记。
An img represents a single graphic within a document, whether or not it is formed by a collection of drawing objects.
<子> Source , 强调我的
关于css - 您可以将任意元素包装在 "figure"中以指示它是 HTML-as-image 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43979987/