What is the difference between “.class element” and “element.class”?

前端 未结 4 1192
独厮守ぢ
独厮守ぢ 2020-12-23 00:04

Is there a difference between .class element and element.class in a CSS selector?

I had always been shown element.class but j

4条回答
  •  清酒与你
    2020-12-23 00:36

    I like to think it as follows:

    1) a, b  =   a OR b
    2) a  b  =   a AND b (on that order)
    3) a.b   =   a.b     (on that order)
    

    2, 3) a b is not the same as b a.
    2) Elements belonging to a and b simultaneously, i.e. nor a or b elements. Is a range selection.
    3) a elements of b class. Is an exact selection.

提交回复
热议问题