CSS: What this Asterisk (*) does?

后端 未结 2 362
故里飘歌
故里飘歌 2021-01-02 07:03

this line of code is for the navigation bar of Apple.com

#globalheader #globalnav[class*=\"nosearch\"] { width:100%; }

Somebody know what t

相关标签:
2条回答
  • 2021-01-02 07:45

    * is very similar to ~ but ~ matches only with space around it.

    E.g.

    foo bar
    

    but not

    foo-bar
    

    * will match both.

    0 讨论(0)
  • 2021-01-02 07:54
    #globalnav[class*="nosearch"]
    

    means: class contains "nosearch"


    #globalnav[class^="nosearch"]
    

    means: class starts with "nosearch"


    #globalnav[class$="nosearch"]
    

    means: class ends with "nosearch"


    Reference: http://reference.sitepoint.com/css/css3attributeselectors

    0 讨论(0)
提交回复
热议问题