gpt4 book ai didi

html - 为什么 cellspacing 和 cellpadding 不是 CSS 样式

转载 作者:技术小花猫 更新时间:2023-10-29 11:34:41 24 4
gpt4 key购买 nike

我不知道为什么这让我如此困扰,但当我创建网站时,我总是尝试使用 CSS 来完成所有样式设置。然而,当我使用表格时,我总是要记住做的一件事是添加 cellspacing="0"和 cellpadding="0"

为什么没有 CSS 属性来覆盖这些过时的 HTML 4 属性?

最佳答案

Cellspacing :

table { border-collapse: collapse; }

至于cellpadding , 你可以这样做

table tr td, table tr th { padding: 0; }

关于html - 为什么 cellspacing 和 cellpadding 不是 CSS 样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/339146/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com