Css 在div语句中更改表的样式时出现问题
我用HTML5创建了一个表,并使用CSS使其美观。然后,我决定添加一个滚动条,并使用webkit更改滚动条的样式。现在,在我使用div使我的滚动条工作之后,我的tbody、tr、thead等的CSS代码似乎不工作了。我想知道我做错了什么。我确信我没有正确调用html表属性。我对html5和css非常陌生,但我真的很想了解更多 这是我的密码: 更新日期:2013年11月7日晚上9:36Css 在div语句中更改表的样式时出现问题,css,html,html-table,webkit,Css,Html,Html Table,Webkit,我用HTML5创建了一个表,并使用CSS使其美观。然后,我决定添加一个滚动条,并使用webkit更改滚动条的样式。现在,在我使用div使我的滚动条工作之后,我的tbody、tr、thead等的CSS代码似乎不工作了。我想知道我做错了什么。我确信我没有正确调用html表属性。我对html5和css非常陌生,但我真的很想了解更多 这是我的密码: 更新日期:2013年11月7日晚上9:36 CSS代码 HTML5代码 播放列表 链接1 链接2 链接3 链接4 链接5 链接6 链接7 .myt
CSS代码
HTML5代码
播放列表
链接1
链接2
链接3
链接4
链接5
链接6
链接7
.mytablcontainer#mytable.td{}
删除td前面的“.”点并更正类的拼写
.mytablecontainer #mytable td {}
每次主div选择器尝试此css时,您无需调用
::-webkit-scrollbar {
width: 12px;
color:crimson;
background-color: black;
border-radius: 10px;
}
::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
border-radius: 10px;
background-color:black;
}
::-webkit-scrollbar-thumb {
border-radius: 10px;
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5);
background-color:gray;
}
.mytablecontainer #mytable{
width:500px;
border-collapse:separate;
background:crimson;
border-radius: 15px;
}
#mytable tbody {
overflow: auto;
height: 150px;
float: left;
width: 100%;
}
#mytable td {
text-align:center;
background:gray;
border-bottom:5px solid black;
border-radius: 15px;
}
#mytable th {
font-weight:bold;
text-align:center;
background:crimson;
border-bottom:5px solid black;
border-top-left-radius: 15px;
border-top-right-radius: 15px;
float: left;
width: 100%;
}
#mytable tr {
width: 100%;
display: table;
}
我只是改变了所有这些,但似乎并没有解决问题:(这对“播放列表”行很有效,但其中一行似乎不正确。谢谢,我很高兴你让它工作。在播放列表行,td标签在哪里?
.mytablecontainer #mytable td {}
::-webkit-scrollbar {
width: 12px;
color:crimson;
background-color: black;
border-radius: 10px;
}
::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
border-radius: 10px;
background-color:black;
}
::-webkit-scrollbar-thumb {
border-radius: 10px;
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5);
background-color:gray;
}
.mytablecontainer #mytable{
width:500px;
border-collapse:separate;
background:crimson;
border-radius: 15px;
}
#mytable tbody {
overflow: auto;
height: 150px;
float: left;
width: 100%;
}
#mytable td {
text-align:center;
background:gray;
border-bottom:5px solid black;
border-radius: 15px;
}
#mytable th {
font-weight:bold;
text-align:center;
background:crimson;
border-bottom:5px solid black;
border-top-left-radius: 15px;
border-top-right-radius: 15px;
float: left;
width: 100%;
}
#mytable tr {
width: 100%;
display: table;
}