开发者

Cancel global css inheritance

开发者 https://www.devze.com 2022-12-14 04:18 出处:网络
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. Wha

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 stuf开发者_StackOverflow社区f.


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.


table
{
  padding: 3px;
}

and/or possibly

table tr
{
  padding: 3px;
}

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号