Home > Web Front-end > CSS Tutorial > How Do I Assign Multiple Classes to an HTML Element?

How Do I Assign Multiple Classes to an HTML Element?

Susan Sarandon
Release: 2024-12-17 10:16:25
Original
874 people have browsed it

How Do I Assign Multiple Classes to an HTML Element?

Assigning Multiple Classes to an HTML Container

Can you assign multiple classes to a single HTML container? It may seem like you could separate the class names with a comma, as in:

<article class="column, wrapper">
Copy after login

However, this will not work. To assign multiple classes to an element, simply remove the comma and use a space instead:

<article class="column wrapper">
Copy after login

This will correctly apply both the "column" and "wrapper" classes to the article element.

The above is the detailed content of How Do I Assign Multiple Classes to an HTML Element?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template