CSS – Cascading Style Sheet
In this lecture you will learn Classes and IDs, you will know what is classes and IDs and how to apply these in CSS
In the CSS, a class selector is a name preceded by a full stop (“.”) and an ID selector is a name preceded by a hash character (“#”).
Here you can also define your own selectors in the form of class and ID selectors.
The benefit of this is that you can have the same HTML element, but present it differently depending on its class or ID.
So the CSS might look something like:
To use classes and ids in styles, add the classes and ids style attribute to the relevant element. The style attribute can contain any CSS property using this you can apply many places.
for instance classes and ids in css examples with source code here: for css classes and ids in html with example
Chocolate Dish
This is my recipe for making curry purely with chocolate
This is Second p tag class to presenting content
The difference between an ID and a class is that an ID can be used to identify one element, whereas a class can be used to identify more than one.
You can also apply a selector to a specific HTML element by simply stating the HTML selector first, so p.recipe { /* whatever */ } will only be applied to paragraph elements that have the class “recipe”.