gpt4 book ai didi

html - css 不覆盖表格单元格填充 ='10'

转载 作者:行者123 更新时间:2023-11-27 23:47:34 25 4
gpt4 key购买 nike

我有一个 html 编辑器 (ckeditor)。我可以用它轻松腾出空间那给了我那个代码

我在这段代码之上有一些 css,它破坏了我的 ckeditor 的第一行。所以 cellpadding 没用,这不是我要找的

我尝试了一个类 nostyle 但没有成功(它在我的帖子的末尾)

<div class='nostyle'>
<p>my title</p>
<!--- beginning of ckeditor source --!>
<table align="center" border="1" cellpadding="10" cellspacing="10" style="margin:100px; padding:100px">
<tbody>
<tr>
<td style="vertical-align:bottom"><img alt="" src="box4m3.png" style="height:147px; width:146px" /></td>
<td style="vertical-align:bottom"><img alt="" src="box8m3.png" style="height:200px; width:199px" /></td>
<td style="vertical-align:bottom"><img alt="" src="box12m3.png" style="height:250px; width:248px" /></td>
</tr>
</table>
<!--- end of ckeditor source --!>

nostyle CSS:

.nostyle{
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
}.nostyle{
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
}

最佳答案

这是不可能的。

specification要求比当 HTML 表示规则和 CSS 规则冲突时,CSS 总是获胜。

The UA may choose to honor presentational attributes in an HTML source document. If so, these attributes are translated to the corresponding CSS rules with specificity equal to 0, and are treated as if they were inserted at the start of the author style sheet. They may therefore be overridden by subsequent style sheet rules. In a transition phase, this policy will make it easier for stylistic attributes to coexist with style sheets.

nostyle.css 定义了 tdth 元素的填充,因此它总是会覆盖 cellpadding 属性.

关于html - css 不覆盖表格单元格填充 ='10',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29046989/

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