The styles applied in the nav section are only effective because they share the same name as the tag being used. Various CSS selectors can be utilized to target different HTML elements such as classes, IDs, attributes, and tag names. Each of them has a unique method of targeting as outlined below:
.class_name{
/* denoted by a period (.) followed by the class name */
}
#id_name{
/* denoted by a pound sign (#) followed by the ID name */
}
[alt="apple"]{
/* enclosed within brackets */
}
nav{
/* direct styling of the element by calling its name */
}
Please keep in mind: use camel case or lower case for naming conventions, do not utilize uppercase or capitalize letters.
For further insights on these basics, check out this link: