Updated: 08/02/2019 by Computer Hope

A class may refer to any of the following:

1. In object-oriented programming, a class is a set of related objects that share common characteristics. Classes are an important component that makes object-oriented programming a powerful and flexible programming paradigm.

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>

The CSS code above shows that classes are denoted by putting a period in front of the name. 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 a lot of damage, but does not deal much. A mage is the opposite.

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