语义HTML:用户列表 [英] Semantic HTML: List of Users

查看:338
本文介绍了语义HTML:用户列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我应该如何标记用户列表?

How should I mark up a list of users?

每个用户都有姓名,图片和职位。

Each user has a name, picture, and job title.

这是怎么回事?

<h1>Venmo</h1>

<h2>Employees</h2>

<ul>
  <li>
    <article>
      <img src="http://www.gravatar.com/avatar/7e6e0e2b73358e47e0b7f83f8111f75b">
      <h3>Matt Di Pasquale</h3>
      <p>Software Engineer</p>
    </article>
  </li>
  <!-- ... -->
</ul>

我应该删除文章元素吗?我应该删除 ul & li 元素?

Should I remove the article elements? Should I remove the ul & li elements?

推荐答案

这不是一个列表用户作为有关用户的数据表。每个用户都有一个图像,一个名称和一个职位。这为你提供了行和列。

This isn't so much a list of users as a table of data about the users. Each user has an image, a name and a job title. That gives you rows and columns.

table {
    display: block;
}
tr {
    display: block;
    overflow: auto;
    clear: left;
    margin-bottom: 10px;
}
td {
    display: block;
    width: 200px;
}
td:first-child {
    float: left;
    width: auto;
}
td:nth-child(2) {
    margin-left: 60px;
    padding-bottom: 6px;
    border-top: solid grey 2px;
}
td:nth-child(3) {
    margin-left: 60px;
    padding-top: 6px;
    border-bottom: solid grey 2px;
}

<table>
    <tr>
        <td>
            <img src="http://b.dryicons.com/images/icon_sets/shine_icon_set/png/256x256/black_female_business_user.png" alt="" width="50" />
        </td>
        <td>Jane Smith</td>
        <td>Software Engineer</td>
    </tr>
    <tr>
        <td>
            <img src="http://b.dryicons.com/images/icon_sets/shine_icon_set/png/256x256/black_female_business_user.png" alt="" width="50" />
        </td>
        <td>Jane Smith</td>
        <td>Software Engineer</td>
    </tr>
    <tr>
        <td>
            <img src="http://b.dryicons.com/images/icon_sets/shine_icon_set/png/256x256/black_female_business_user.png" alt="" width="50" />
        </td>
        <td>Jane Smith</td>
        <td>Software Engineer</td>
    </tr>
</table>

这篇关于语义HTML:用户列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆