In the previous study we used only HTML selectors (HTML tags in HTML pages, such as P)
Now we learn to use CLSS and IDs to define our own selectors.
In this way, the same HTML element can use a different representation by class or ID.
In CSS, use the dot number ( . ) to create the class selector and use the hash symbol ( # ) to create the ID selector.
Example
#top {background-color: #ccc;padding: 1em}.intro {color: red;font-weight: bold;}
HTML pages id class call CSS through and properties, as follows:
id="top"class="intro"class="intro">Mmm mm mmmmm</p></div>
The difference between ID and class indicates that one page can only have one ID at a time, and class can be used without restrictions.
Again, you can use a selector behind the HTML selector to specify a particular HTML element, such as a p.jam{值} paragraph that will function with the ' Jam ' class attribute.