取消全局css继承

发布于 2024-08-14 23:11:19 字数 294 浏览 2 评论 0原文

我有一个全局重置规则:

* {
margin:0px;
padding:0px;
}

我还有很多带有预定义单元格填充值的表格。然而,全局重置规则正在杀死所有单元格填充值。无需为每个表格创建特定的 CSS 规则即可恢复单元格填充的最佳方法是什么? (有很多表格。)

编辑:澄清一下,如果我取出 padding:0px; 规则,那么所有表格都会看起来很完美。但是,我仍然需要对其他东西进行全局重置。

I have a global reset rule:

* {
margin:0px;
padding:0px;
}

I also have a LOT of tables with pre-defined cellpadding values. However, the global reset rule is killing all the cellpadding values. What would be the best way to get the cellpadding back without having to create a specific css rule for each table? (There are a lot of tables.)

EDIT: to clarify, if I took out the padding:0px; rule then all the tables would look perfect. But, I still need the global reset for other stuff.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

纸短情长 2024-08-21 23:11:19

最好的选择是使用重置表,例如 Eric Meyer 的,并剪裁那里的桌子。

奇怪的是,内联格式化应该胜过全局格式化。

Your best bet is to use a reset sheet like Eric Meyer's, and cut-out tables from there.

What is odd is that inline formatting should be trumping global formatting.

如此安好 2024-08-21 23:11:19
table
{
  padding: 3px;
}

和/或可能

table tr
{
  padding: 3px;
}

和/或可能 td、th 和所有其他表相关元素。

table
{
  padding: 3px;
}

and/or possibly

table tr
{
  padding: 3px;
}

and/or possibly td, th and all other table related elements.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文