【发布时间】:2010-12-09 09:52:35
【问题描述】:
如果使用 top: 0; 定义 CSS 规则,我以后如何禁用或中和它以支持在其他地方使用的 bottom: 0;?
【问题讨论】:
标签: css
如果使用 top: 0; 定义 CSS 规则,我以后如何禁用或中和它以支持在其他地方使用的 bottom: 0;?
【问题讨论】:
标签: css
do top: auto; bottom:0; - auto 是 top 的默认值
【讨论】:
top: auto; 确实回答了描述中的问题,但它没有回答标题中关于如何禁用或重置 css 规则的问题。
top: auto;
bottom: 0px;
【讨论】:
如果您有拉伸问题,只需使用 initial 重置规则
top: initial;
或
bottom: initial;
【讨论】:
CSS 是级联的,例如,如果你把 p { top: 0;) 放在前面,p.bottom {top:auto; bottom: 0;) 放在后面,你的 css 会听后者的 p.bottom
【讨论】:
bottom: 0 不会覆盖top: 0,它只会被添加到规则中,使元素从上到下延伸