What is CSS class?

Experience Level: Junior
Tags: CSS


  • Css calss is a type of selector represent with dot before.
  • Selects all elements with a matching class attribute.
Example of Class atribut in HTML
	<div class="main-p">
		<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
Example of Class selector in CSS
.main-p {
    border:solid 2px red;
Related CSS job interview questions
CSS for beginners
CSS for beginners

Are you learning CSS? Try our test we designed to help you progress faster.

Test yourself