CSS英文命名是否适当,需要修改吗?

时间:2019-01-10 11:04:14

标签: css html-table naming

CSS英文命名是否合适并且需要修改?

正在编写表格模板,我的英语不好。 CSS(class =“ xxx”)英文名称合适吗?

需要修改什么?

无论是英语语法还是描述,希望得到一些修改建议。

谢谢

<!-- =table: start -->
<table class="list-table-m" summary="summary">
    <caption>table caption</caption>
    <thead>
        <tr>
            <th scope="col" class="col-id">
                <a class="sort sort-asc-active" href="#">
                    <i class="icon icon-sort-asc"></i>
                </a>
            </th>
            <th scope="col" class="col-user-number-name"></th>
            <th scope="col" class="col-user-number-id"></th>
            <th scope="col" class="col-dept-office"></th>
            <th scope="col" class="col-title"></th>
            <th scope="col" class="col-describe"></th>
            <th scope="col" class="col-price">
                <a class="sort sort-desc-active" href="#">
                    <i class="icon icon-sort-desc"></i>
                </a>
            </th>
            <th scope="col" class="col-date-full"></th>
            <th scope="col" class="col-state"></th>
            <th scope="col" class="col-edit"></th>
        </tr>
    </thead>
    <tbody>
    </tbody>
</table>
<!-- =table: end -->

<!-- =cell data: start -->
<span class="text-user-number-name">
    <i class="number"></i>
    <span class="name"></span>
</span>
<span class="text-user-number-id">
    <i class="number"></i>
    <i class="id"></i>
</span>
<span class="text-dept-office">
    <span class="dept"></span>
    <span class="office"></span>
</span>
<span class="text-user-number-name-inline">
    <i class="number"></i>
    <span class="name"></span>
</span>
<span class="text-user-number-id-inline">
    <i class="number"></i>
    <i class="id"></i>
</span>
<span class="text-dept-office-inline">
    <span class="dept"></span>
    <span class="office"></span>
</span>
<p class="cell-title"></p>
<p class="textarea-m"></p>
<i class="text-price"></i>
<span class="date-full">
    <i class="df-date"></i>
    <i class="df-time"></i>
</span>
<span class="date-df"></span>
<span class="time-df"></span>
<span class="operate-area">
    <!-- <a class="link-xxx" href="#"> -->
        <i class="icon icon-view"></i>
        <i class="icon icon-edit"></i>
        <i class="icon icon-delete"></i>
        <i class="icon icon-success"></i>
        <i class="icon icon-remove"></i>
        <i class="icon icon-lock"></i>
        <i class="icon icon-unlock"></i>
        <i class="icon icon-link"></i>
        <i class="icon icon-share"></i>
        <i class="icon icon-refresh"></i>
        <i class="icon icon-upload"></i>
        <i class="icon icon-download"></i>
    <!-- </a> -->
</span>
<!-- =cell data: end -->

1 个答案:

答案 0 :(得分:0)

只要 you 知道它们的作用和含义,您对自己的班级起什么名字都没关系。有时候很难想出好的类名,但是只要您不将代码交给其他人阅读,就可以了。

但是,我建议如果您只使用一次类,例如col-pricecol-describe,请改用id,因为它更“正确”。