It seems like i have a class limitation.
When i add another class it dosent get coloured and the effect dosent show on my
webpage.
When i delete a working class, suddenly i can add a class and it works.
Thats why it feels like a class limitation.
I hope you can find a solution with me <3 .
Btw sorry for my bad english
You need to explain what’s happening. What element are you adding classes to? Do you have an example of the code that doesn’t work? Which part does work?
Also, side issue but those class names are not good, they are going to make things exceptionally difficult for you to follow the more you add
The problem is that the class (#sbb) is not working. when i add another class it dosent work too. But when i delete a working class like #bb and insert the exact same code from #sbb it works.
That gives me the feeling of limitation in the amount of classes i can use at once.
They’re not classes, they’re ids, hence id="bb" and #bb. There are no CSS classes being used in that code at all. The original code has classes, this does not.
If you’ve just mistyped on the forum and they are actually classes in your real code, this still doesn’t really help – what do you mean “isn’t working”. what isn’t working?
It is easier if you can provide a Codepen that demonstrates what happens
ieahleen and DanCouper are to the point. You are confusing ids with classes. Classes are added as class="classname1 classname2 classname3" etc to an element while id is added as id ="myId".
Please note that while each element can have only one ID and each ID in a page are unique (i.e. different from each others). Classes however are reusable and different elements can share same classes for styling elements similarly. Classes use dot (.) notation for selection instead of # symbol used for IDs.
An example is below:
<div id="bb" class="bb sbb">
My BB div content. Applies styles from both bb and sbb class
</div>
<div id="sbb" class="sbb">
My SBB div. Only applies styles from sbb class.
</div>
css can now be applied as follows:
.bb {
background-color: white;
text-align: center;
}
.sbb {
background-color: white;
text-align: center;
/* Add more declarations/styles as per need*/
}