weiruanniubi
V2EX  ›  问与答

求助前端大神。

  •  
  •   weiruanniubi · Aug 25, 2019 · 1767 views
    This topic created in 2633 days ago, the information mentioned may be changed or developed.

    我就是想全站把:before给去掉,现在是这样的:

    .entry .entry-title:before {
    display: none;
    }
    .comments-area .comments-title-wrap .comments-title:before {
    display: none;
    }
    .post-navigation .nav-links .nav-next .meta-nav:after {
    display: none;
    }
    .post-navigation .nav-links .nav-previous .meta-nav:before {
    display: none;
    }
    
    这样太啰嗦了,能不能一句就把全站的:before去掉呢?

    6 replies  •  2019-08-25 21:35:52 +08:00
    gy134340
    gy134340
    Aug 25, 2019
    1
    * :before {
    display: none !important;
    }

    这样行吗
    sunjourney
    sunjourney
    Aug 25, 2019
    2
    *::before {
    content: none;
    }
    sunjourney
    sunjourney
    Aug 25, 2019
    3
    加个 !important 提高权重
    crazybinggan
    crazybinggan
    Aug 25, 2019
    4
    还是乖乖这样写,如果像楼上那种全局的搞法,需要加 `!important`,然后你后面的接手有需要用到的,就懵逼了,要解决就继续用 `!important` 覆盖前面的,一发不可收拾,后果知道猜的到吧...
    weiruanniubi
    weiruanniubi
    OP
    Aug 25, 2019
    5
    @gy134340
    @sunjourney
    感谢大神,解决了。
    weiruanniubi
    weiruanniubi
    OP
    Aug 25, 2019
    6
    @crazybinggan 没事,是我自己的博客……
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   3692 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 441ms · UTC 09:57 · PVG 17:57 · LAX 01:57 · JFK 04:57
    ♥ Do have faith in what you're doing.