您可以将任意元素包装在 "figure" 中以表明它是 HTML-as-image 吗?
Can you wrap arbitrary elements inside a "figure" to indicate that it's HTML-as-image?
如果您以非语义方式使用 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 角色添加到 figure
可能会进一步改进标记。
An img represents a single graphic within a document, whether or not
it is formed by a collection of drawing objects.
Source,强调我的
如果您以非语义方式使用 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 角色添加到 figure
可能会进一步改进标记。
An img represents a single graphic within a document, whether or not it is formed by a collection of drawing objects.
Source,强调我的