Class

Updated: 12/31/2022 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 with common characteristics. Classes are an important component that makes object-oriented programming a powerful and flexible programming paradigm.

CSS class

2. With CSS (Cascading Style Sheets), a class is a selector used to specify a style on an HTML (HyperText Markup Language) element. For example, the below class called center could be created to center the text on a paragraph.

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 before the name. A line that does not begin with a period is considered an HTML tag selector, and an id selector begins with a #.

Note

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, cleric, rogue, and mage are examples of game classes. A warrior is often strong and can withstand damage but does not deal much. A cleric is a support class that heals teammates. A rogue can deal a lot of physical damage with blades or bows. A mage can deal a lot of magical damage but not take as much damage.

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