I don’t quite understand your question, but I’ll pass on some general knowledge, hopefully it’ll help you understand.
Any HTML element can have certain attributes. Some of the possibilities are class, id, and name. They are declared like so: <div id="foo" class="bar" name="snafu">
The name is not normally used in CSS. When it is used as a form element, the element’s name attribute is used to determine the array key name in data passed to the server.
Both class and id can be used in CSS selectors. By the rules of constructing valid HTML, a particular id can only be used once on a page. Classes can occur any number of times. Thus, if you use an id selector on a proper HTML page, the associated CSS rules will only apply to that one element. A CSS id selector is preceded with a hash mark. I could set the color of the previous div element like so: #foo { color: red; }
I could also set the color like so: .bar { color: red; }
using the class selector, which precedes the class with a dot. However, except when a more specific rule overrides our CSS, any other element with class bar will also have red text.
We can apply CSS to a specific element with only a general, commonly used class if there is another attribute that distinguishes it from all other elements with the bar class by combining selectors. Perhaps our target div with class bar is the only element that has a parent with the id of my-post. We can create a CSS rule like so: #my-post .bar { color: red; }
This means the red text color rule will only be applied to elements with the bar class that are inside a parent element with the id my-post. Any other bar class elements will not be affected.
There’s numerous ways classes and rules can be combined, along with pseudo selectors and other operators so that you generally can zero in on any one specific element by being clever with how you construct the selector.