CSS Dot Notation Naming Convention

后端 未结 6 1606
余生分开走
余生分开走 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:27

    A '.' refers to a class, while a '#' refers to a id. When neither a '.' or a '#' are used, the CSS will apply the style to an HTML object. So for p .one and p .two, the CSS will be applied to the '.one' and '.two' classes that exists within the 'p' object.

    For a more detailed example;

    This text will have the CSS of "p .one"

    This text will have the CSS of "p .two"

提交回复
热议问题