【发布时间】:2012-04-06 02:22:10
【问题描述】:
我正在编写一些 codex,例如文档 here,我想编写标记,使其看起来像 docblock 例如:
@param string lastName the last name of the person
@param string firstName the first name of the person
@return string
我正在尝试找出最语义化的元素是什么(例如pre 或dl 或table 或div 和span 的组合),我也想实现它响应式的,因此通过 CSS 在小屏幕上看起来像:
@param
string
lastName
the last name of the person
@param
string
firstName
the first name of the person
@return
string
我以前为此使用过 2 种解决方案。第一个使用pre,其中包含一些br 标签,这些标签在某个断点之上设置为display:none。另一种是使用table 和媒体查询,例如:
@media all and (max-width:640px) {
table,thead,tbody,tfoot,th,td,tr{display:block}
tr+tr{margin-top:1em}
}
我也愿意接受任何其他想法。你认为最符合语义的方式是什么?
【问题讨论】:
标签: html css semantics semantic-markup responsive-design