小编Dan*_*bio的帖子

是否可以使用ID标记来更改css内容

有没有办法从HTML获取ID

例如:

 id="title1"
Run Code Online (Sandbox Code Playgroud)

所以它需要显示在css中的content:部分.

    <table class="layout display responsive-table">
        <thead>
            <tr>
                <th class="th" id="title1">Title12</th>
                <th class="th">Title2</th>
                <th class="th">Title3</th>
                <th class="th">Title4</th>
            </tr>
        </thead>


table.responsive-table td:nth-child(1):before {
        content: use id here;
    }
    table.responsive-table td:nth-child(2):before {
        content: 'Title 2';
    }
Run Code Online (Sandbox Code Playgroud)

html css html5 css3

2
推荐指数
1
解决办法
58
查看次数

标签 统计

css ×1

css3 ×1

html ×1

html5 ×1