How to Apply Multiple CSS Class Selectors

CSS is a powerful programming language that is designed for use in conjunction with HTML. With CSS, multiple class selectors (a group of settings that affect how HTML is displayed) can be applied to specific parts of HTML documents. If you have multiple CSS class selectors that you'd like to apply to an HTML element, this can be done with a few CSS code insertions.

Instructions

    • 1

      Open the CSS file that you have linked to your HTML file and take note of the names of the class selectors you'd like to apply in your HTML file. When ready, close the CSS file and open the HTML file.

    • 2

      Navigate to the HTML element to which you'd like to apply the CSS class selectors and click inside of it. It can be any HTML element; such as <p>, , <font>, or <div>.

    • 3

      Type the following text in the HTML element (such as <p>, as shown in the following example), replacing the text "one," "two" and "three" with the names of your CSS class selectors: <p class="one two three">

    • 4

      Save your HTML file; the CSS class selectors you put in the HTML element will go into effect at once.

Tips & Warnings

  • You can use as many CSS class selectors as you want. If you have more than three class selectors to apply to your HTML element, simply insert a space in between the additional class selector names.

Related Searches:

References

Comments

You May Also Like

Related Ads

Featured