我们在同一页面中有两个不同的表。另一个目的需要使用不同的ID。因此,我们在Style中创建了多个CSS表格元素。但是只有第一个在工作。如果我将客户的设计放在首位,它将被应用,但一次只能应用一次。
#salescss {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
}
#salescss td, #salescss th {
border: 1px solid #ddd;
padding: 8px;
}
#salescss tr:nth-child(even){background-color: #f2f2f2;}
#salescss tr:hover {background-color: #ddd;}
#salescss th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
background-color: #357EC7;
color: white;
body {font-family: Arial;}
#customers {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
}
#customers td, #customers th {
border: 1px solid #ddd;
padding: 8px;
}
#customers tr:nth-child(even){background-color: #f2f2f2;}
#customers tr:hover {background-color: #ddd;}
#customers th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
background-color: #357EC7;
color: white;
body {font-family: Arial;}
答案 0 :(得分:0)
您在}
和#salescss th {
之后缺少#customers th {
#salescss {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
}
#salescss td, #salescss th {
border: 1px solid #ddd;
padding: 8px;
}
#salescss tr:nth-child(even){background-color: #f2f2f2;}
#salescss tr:hover {background-color: #ddd;}
#salescss th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
background-color: #357EC7;
color: white;
}
body {font-family: Arial;}
#customers {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
}
#customers td, #customers th {
border: 1px solid #ddd;
padding: 8px;
}
#customers tr:nth-child(even){background-color: #f2f2f2;}
#customers tr:hover {background-color: #ddd;}
#customers th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
background-color: #357EC7;
color: white;
}
body {font-family: Arial;}