div.classname in css file

后端 未结 12 653
臣服心动
臣服心动 2020-12-10 02:21

I have seen some developers write

HTML:

some content

CSS:

12条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-10 03:01

    Does this mean this style will be applied only when the class is applied to a div ?
    Yes


    The previous rule will not in deed have any effect on span


    The reason for such choice depends on the context. In general, any css style is to focus on a particular element on a given page otherwise you will have

    div { .... }

提交回复
热议问题