Home  >  Q&A  >  body text

如何让某个 div 内的样式初始化?

我想网站某个 div 的样式为最初始的样式,不希望父级样式影响,应该如何操作?


看透不说透看透不说透2773 days ago955

reply all(2)I'll reply

  • 数据分析师

    数据分析师2017-10-01 00:53:54

    How to initialize the style within a certain div? -PHP Chinese website Q&A-How to initialize the style within a certain div? -PHP Chinese website Q&A

    Let’s take a look and learn.

    reply
    0
  • 迷茫

    迷茫2017-03-17 09:33:55

    把某一个div恢复成div最初的样式?不希望父级的影响?
    要我说,就给你需要初始化的div设置个class,因为继承而来的样式权重是0,所以class足够了,如果有明确的设置过这个div的class 那就.class.class增加一下权重就好了。如果有id那就设个id覆盖掉!
    然后剩下的事就是直接添加css内容,比如border不想要,直接设置一个border:none就够了。

    reply
    0
  • Cancelreply