您将如何使用语义 HTML 标记建筑平面图/地图?
该建筑(博物馆)有 7 层(+3 至 -3),每层分为不同的房间/区域。 将鼠标悬停在某个区域上将显示一个描述该区域的弹出窗口。
我正在寻找一些能够准确表示 7 个级别及其区域的标记。 该计划应该有意义并且无需任何 CSS/JS 即可“导航”。
编辑:一些澄清,标记只需代表建筑物的“语义结构”,而不是空间布局(CSS 将添加到布局和图形中)。
The building (a museum) has 7 levels (+3 to -3), each divided into different rooms/areas. Hovering over an area will reveal a popup describing that area.
I'm looking for some markup that will accurately represent the 7 levels and their areas.
The plan should make sense and be 'navigable' without any CSS/JS.
Edit: Some clarification, the markup only has to represent the 'semantic structure' of the building, not the spatial layout (CSS will add in the layout and graphics).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
对我来说,这就像一个嵌套的、无序列表。
Smells like a nested, unordered list to me.
听起来像是 SVG 的工作? (圣何塞的 Adobe 建筑示例)
我意识到这确实使用 JavaScript,但是如果你有 7 层 * 10+ 房间呢? 如果使用纯 CSS,这会变得相当麻烦。 您可以使用一些
元素来制作嵌套的房间级别,但如果建筑物这么大,我认为列表(即使呈现为块)对于查看来说没有意义。
Sounds like a job for SVG? (Sample Adobe Building in San Jose)
I realize that this does use JavaScript, but if you have 7 floors * 10+ rooms? this would get rather hairy with pure CSS. You could use some
<ul>
elements to make nested levels of rooms, but if the building is this big, I don't think the list (even if rendered as blocks) would be meaningful to view.查看微格式,特别是XOXO 微格式。
Take a look at microformats, specifically the XOXO Microformat.
使用 HTML5(但如果您想使用 HTML 4.01,应该不会有太大区别):
如果您想用图像表示建筑物,您可以使用 图像地图,由
map
和区域
。area
(href
属性)可以链接到包含房间详细描述的页面。alt
属性可以包含房间的简短描述,例如“草莓房间(4 级)”。如果标记更像是文本替代(例如,如果您使用
object
、canvas
或类似的东西),我会使用标题结构:(对于 HTML 4.01,您可以使用
div
而不是section
并相应地调整标题级别)Using HTML5 (but shouldn't make a big difference if you'd like to use HTML 4.01):
If you want to represent the building with images, you can use an Image Map, consisting of
map
andarea
. Thearea
(href
attribute) could link to a page containing the detailed description of the room. Thealt
attribute could contain a short description of the room, like "Strawberry room (level 4)".If the markup is more like a text-alternative (for example, if you'd use
object
,canvas
or something like that), I would go with a heading structure:(for HTML 4.01, you would use
div
instead ofsection
and adjust the heading level accordingly)