CSS, table border
If table is set to have a border on a high level, how 开发者_高级运维can i make sure that classes inhering from it do not have any borders set?
table,td,th {
border: 1px solid #0B6121;
}
how can i make sure that my other table has no borders at all?
table.menu {
border: none;
- and no border for td
- and no border for th
}
table.main, table.menu td, table.menu td {
border: none;
}
This way I guess. The idea is to set rules for siblings of your particular table.
table.menu, .menu th, .menu td {
border:none;
}
sometyhing like this?
Like this :
table.menu td, table.menu tr{
border:none;
}
As your code stands
<table class="menu"></table>
will not have an outside border, but any th and td elements inside will inherit the border from your global selector.
The other answers that demonstrate applying specific rules to the td and th elements inside of a table with class of 'menu' should help you out.
精彩评论