How to create a class in CSS

When you would like to make use of CSS to call up a specific HTML element it is of vital importance to assign a class or an id to the actual HTML element. An id can only be used once per HTML page while a class can appear several times on the same page because it allows you to call up various elements at the same time. Via CSS a class can be called up by means of a point (.), followed by the value. In the below example we will show you how to create a class in HTML, after which we will also show you how this particular class needs to be called up via CSS:

<div class="example"></div>
.example{
}


Was this useful?