Classes are a nice feature in HTML that allows you to assign a certain name to an element. They can be styled using CSS. If you don't know how to use those features, this article will help you.

Steps

  1. 1
    Make your HTML document.
  2. 2
    Create the basic HTML skeleton. As a reminder, it's an opening HTML tag, an opening head tag, a closing head tag, an opening body tag, a closing body tag, and a closing html tag.
    Advertisement
  3. 3
    Create a HTML element. It can be a paragraph, heading, or whatever you want.
  4. 4
    Give the HTML element a class. Do this by inserting "class="classname" inside the opening tag for your element.
  5. 5
    Put a "style" tag between the head tags. You'll put your CSS here.
  6. 6
    Call your class. This is done by putting ".classname { }" in the CSS document.
  7. 7
    Put the styles your want between the curly brackets.
  8. 8
    Enjoy your styled HTML element!
  9. Advertisement

About This Article

wikiHow is a “wiki,” similar to Wikipedia, which means that many of our articles are co-written by multiple authors. To create this article, volunteer authors worked to edit and improve it over time. This article has been viewed 74,905 times.
How helpful is this?
Co-authors: 7
Updated: October 21, 2021
Views: 74,905
Categories: Markup Languages
Advertisement