Using regular expression in css?

前端 未结 8 1715
野的像风
野的像风 2020-11-22 06:01

I have an html page with divs that have id(s) of the form s1, s2 and so on.

8条回答
  •  借酒劲吻你
    2020-11-22 06:26

    First of all, there are many, many ways of matching items within a HTML document. Start with this reference to see some of the available selectors/patterns which you can use to apply a style rule to an element(s).

    http://www.w3.org/TR/selectors/

    Match all divs which are direct descendants of #main.

    #main > div
    

    Match all divs which are direct or indirect descendants of #main.

    #main div
    

    Match the first div which is a direct descendant of #sections.

    #main > div:first-child
    

    Match a div with a specific attribute.

    #main > div[foo="bar"]
    

提交回复
热议问题