我描述一个表中的CSS元素,它包含此行:混淆表CSS
.pricing tr td:last-child { text-align: right; }
这使得最后一列文本右对齐。定价类是我试图编辑的表的类。 我还没有真正能够找出或找到任何地方在CSS中列出表格标签的规则。如果我把:
table .pricing tr td:last-child { text-align: right; }
或
.pricing table tr td:last-child { text-align: right; }
,这一行也不行。但是,如果我把:
table.pricing tr td:last-child { text-align: right; }
然后它确实工作。
是什么使得它更加混乱,是我编辑主题的CSS,它有这些行:
table caption { font-weight: bold; text-align: left; padding: 4px 6px; border: 1px solid #ddd; border-bottom: 0; background: #ffd53c url(img/pattern.png); }
table th, table td { padding-left: 6px; padding-right: 6px; line-height: 21px; border: 1px solid #ddd; background-color: #fff; text-align: left; vertical-align: middle; }
table th, table tfoot td { font-weight: bold; background: #eee url(img/pattern.png); }
table tfoot a { text-decoration: none; }
table .alternate td { background-color: #fafafa; }
table.large th,table.large td { padding: 12px 8px; }
我只是想弄清楚一个规则,当把表,何时不放表,是否必须写tr tr或td,在哪里放置类选择器(在所有之前,中间,有无表等)。
需要查看您的表格HTML。 – BoltClock
@BoltClock这是非常简单的,只是这样的: '<表类= “定价”>