It’s “class”, not “CSS class”
Sometimes when people talk about class names in HTML, they mistakenly call them “CSS classes”. I’m guessing that most of the time this is something they have picked up from server side development frameworks that use “CssClass” properties to specify the value of class attributes. Another possible source is content management systems that use “CSS Class” in their editor interfaces.
I wouldn’t see a problem with this if the class attribute in HTML and XHTML had no other purpose than letting the author apply CSS rules. But it does. Deciding which elements a JavaScript function should affect, for instance. It can be a bit confusing to talk about “CSS classes” when they won’t be used with CSS.
So please try to refer to values of the HTML class attribute as classes, class names or HTML classes instead of CSS classes.
This post is a Quick Tip. Background info is available in Quick Tips for web developers and web designers.
Translations
This article has been translated into the following languages:
- Turkish: CSS Sınıfı değil, Sınıf
- Previous post: No more pixel perfectionism in IE 6
- Next post: The alt attribute is for images only
Comments are disabled for this post, but if you have spotted an error or have additional info that you think should be in this post, feel free to contact me.
Sponsors
Authentic Jobs
DreamHost web hosting
Use the promo code 456BEREASTREET3 to save USD 20 when you sign up for DreamHost

