Suggest an editImprove this articleRefine the answer for “How do you set styles by class?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)**Styling by class** is done through a selector with a dot `.` before the class name (for example, `.title { color: blue; }`), which applies to all elements with the attribute `class="title"`. **Key point:** an element can have several classes at once, and a single class can apply to many elements on a page.Shown above the full answer for quick recall.Answer (EN)ImageTo set styles by class, a dot `.` is placed before the class name. In HTML the class is specified through the `class` attribute, and in CSS through a selector with a dot. --- ### **Example** **HTML:** ```html <p class="title">Heading</p> ``` **CSS:** ```css .title { color: blue; font-size: 24px; } ``` The styles will apply to all elements that have the class `title`. --- ### **Features** - one class can be used multiple times - an element can have **several classes**: ```html <p class="title big">Text</p> ``` - a single class selector can select *many elements* on a page --- **Summary:** to style elements by class, CSS uses a selector with a dot before the class name, and the rule applies to all elements with that class.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.