Updated: 10/11/2017 by Computer Hope

A class may refer to any of the following:

1. With object-oriented programming, this term refers to a set of related objects that share common characteristics. Classes and the ability to create new classes are what make object-oriented programming a powerful and flexible programming model.

CSS class

2. With CSS, a class is a selector used to specify a style on an HTML element. For example, the below class called center could be created to center text on a paragraph of text.

CSS class code

.center { text-align: center; }

HTML <p> tag with center class

<p class="center">This text would be centered.</p>

As can be seen in the above CSS code, every CSS class needs a period in front of the name of the class to be defined as a class. A line that does not begin with a period is considered an HTML tag selector and an id selector begins with a #.


Never start a CSS class with a number since not all browsers support class names beginning with numbers.

3. With an IP address, a class is a section or group of IP addresses. See our IP definition for a listing of each of the IP classes.

4. In a game, a class is a character based on abilities. For example, a warrior and mage are both examples of game classes; a warrior is often strong can withstand lots of damage, but does not deal lots of damage and a mage is the complete opposite.

Game terms, Private class, Programming terms, Public class, Race, Web design terms