I am quite used to seeing
div.class1
and
#someId.class1
but what about
.class1.class2
? And I think it is identical to
.class2.class1
? Because there was an element with id someId
but now we have two elements of this type showing on the page, so I want to add a class and use the class instead of id, therefore the .class1.class2
instead of #someId.class1
The Order of CSS Classes in HTML Doesn't Matter.
CSS class name never affects any factor of SEO. Because a class name is only to identify a particular section of designing. The class name can be used by CSS and JavaScript to perform certain tasks for elements with the specified class name. Save this answer.
The .class selector selects elements with a specific class attribute. To select elements with a specific class, write a period (.) character, followed by the name of the class. You can also specify that only specific HTML elements should be affected by a class.
To specify multiple classes, separate the class names with a space, e.g. <span class="left important">. This allows you to combine several CSS classes for one HTML element.
It will select items with both classes. So not items with either one.
<span class="class1 class2"></span>
Yes, it is both legal and common. In the element, you would have something like this:
<div class="class1 class2">Hello</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With