扫码关注官方订阅号
我想网站某个 p 的样式为最初始的样式,不希望父级样式影响,应该如何操作?
闭关修行中......
把某一个p恢复成p最初的样式?不希望父级的影响?要我说,就给你需要初始化的p设置个class,因为继承而来的样式权重是0,所以class足够了,如果有明确的设置过这个p的class 那就.class.class增加一下权重就好了。如果有id那就设个id覆盖掉!然后剩下的事就是直接添加css内容,比如border不想要,直接设置一个border:none就够了。
猥亵它吧!
p { font-size: inherit!important; font-weight: inherit!important; font-style: inherit!important; color: inherit!important; padding: inherit!important; margin: inherit!important; /* 需要的就加 */ }
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
把某一个p恢复成p最初的样式?不希望父级的影响?
要我说,就给你需要初始化的p设置个class,因为继承而来的样式权重是0,所以class足够了,如果有明确的设置过这个p的class 那就.class.class增加一下权重就好了。如果有id那就设个id覆盖掉!
然后剩下的事就是直接添加css内容,比如border不想要,直接设置一个border:none就够了。
猥亵它吧!