What is a Class?

A class is an attribute used to identify a group of HTML elements with the same or similar characteristics, such as color. You can add an infinite number of elements to each class, and each element can be assigned to multiple classes.


Web Design

More About Classes

A class allows HTML elements to perform certain tasks within the specified class name. For instance, you can create a class with a predetermined font name, size, color, and padding. Then, you can use that class to equally style various elements on a page. The same class can be applied to multiple HTML elements, while ID’s are unique to only one specific HTML element.

<style>
.class-name {
  font-family: Ubuntu;
  font-size: 14px;
  color: orange;
  padding: 20px;
  background-color: white;
}
</style>
Special Offer
Custom Website Design
Get a one-of-a-kind, mobile-friendly website that makes your brand truly shine. Share your vision with us and we'll take it from there.