我需要显示本周哪些商店开放或关闭。为可访问性(屏幕阅读器等)执行此操作的最佳方法是什么?
如果可能,我会优先不使用表格,因为这会使我很难实现我对“普通”用户所需的布局。
<h2>First shop</h2>
<ul>
<li>
Monday open
</li>
<li>
Tuesday closed
</li>
<li>
Wednesday closed
</li>
<li>
Thursday open
</li>
<li>
Friday open
</li>
<li>
Saturday closed
</li>
<li>
Sunay closed
</li>
</ul>
<h2>Second shop</h2>
<ul>
<li>
Monday closed
</li>
<li>
Tuesday open
</li>
<li>
Wednesday closed
</li>
<li>
Thursday open
</li>
<li>
Friday open
</li>
<li>
Saturday closed
</li>
<li>
Sunay closed
</li>
</ul>
答案 0 :(得分:3)
使用定义列表。它们是关联数组的HTML等价物。缩短版本:
<dl>
<dt>Monday</dt><dd>open</dd>
<dt>Tuesday</dt><dd>closed</dd>
...
...
...
</dl>