Home >Web Front-end >CSS Tutorial >Can HTML Containers Have Multiple Classes?

Can HTML Containers Have Multiple Classes?

DDD
DDDOriginal
2024-12-07 16:31:12538browse

Can HTML Containers Have Multiple Classes?

Assigning Multiple Classes to HTML Containers

Is it possible to assign more than one class to a single HTML container? For example, consider the following:

<article class="column, wrapper"> 

How does this work?

Answer

To assign multiple classes to an HTML container, simply remove the comma between the class names. The correct syntax is:

<article class="column wrapper">

This will assign both the "column" and "wrapper" classes to the

element.

The above is the detailed content of Can HTML Containers Have Multiple Classes?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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