CSS Dot Notation Naming Convention

后端 未结 6 1609
余生分开走
余生分开走 2020-12-31 13:48

I am getting started with learning CSS.

While looking through the tutorial on w3schools.

I realized some of the example start with

.awesom         


        
6条回答
  •  春和景丽
    2020-12-31 14:22

    The dot notation is for class and without dot that would not work. The selector name like div, p don't need dot notation. And use hash (#) for the selector with id.

    Ex-

    foo bar
    foo bar
    #foo{} /* selects foo with id foo */ .bar{} /* selects foo with class bar */ div{} /* selects the div */

提交回复
热议问题