Classes are neither semantic or insemantic, merely sensible or insensible.
Realising that classes aren't subject to the same semantics as elements is a massive breakthrough for a front-end developer to make IMO.
These classes aren't 'semantic' because no classes are; semantics in the front-end development sense is when something (i.e. a machine) can glean meaning from something. No machines (browsers, search bots, assistive technologies etc) actually interpret classes, they merely match them. The only thing that gleans meaning from a class is a human, so you should write classes for people.
Thus, in a roundabout way, no classes are semantic, so we need to stop worrying about that.
> but I feel that classes give more meaning to an element
But they don't. Classes (and IDs) have nothing at all to do with semantics or meaning.
You can use whichever notation you wish (.big, .small, .alpha, .giga etc), I state as much at the end of the article, just remember that classes do not add meaning to (or subtract meaning from) an element :)
5 comments
[ 11.4 ms ] story [ 17.3 ms ] threadI am totally in for the alpha notations as I feel more comfortable with it. Plus its semantic.
Realising that classes aren't subject to the same semantics as elements is a massive breakthrough for a front-end developer to make IMO.
These classes aren't 'semantic' because no classes are; semantics in the front-end development sense is when something (i.e. a machine) can glean meaning from something. No machines (browsers, search bots, assistive technologies etc) actually interpret classes, they merely match them. The only thing that gleans meaning from a class is a human, so you should write classes for people.
Thus, in a roundabout way, no classes are semantic, so we need to stop worrying about that.
Cheers for the comment!
I understand that they take the meaning away from standard elements but I feel that classes give more meaning to an element.
p.small and p.big are all the way more logical than styling them according to the container that encloses them.
But they don't. Classes (and IDs) have nothing at all to do with semantics or meaning.
You can use whichever notation you wish (.big, .small, .alpha, .giga etc), I state as much at the end of the article, just remember that classes do not add meaning to (or subtract meaning from) an element :)
H
Pretty cool then :)