Home > Web Front-end > HTML Tutorial > Why does the class class in css have two names? Or what does it mean? _html/css_WEB-ITnose

Why does the class class in css have two names? Or what does it mean? _html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:01:09
Original
2030 people have browsed it

What does it mean to write 2 names in a css class?

<div class="path cl"></div>
Copy after login

What do path and cl mean? Why are there two? Please explain.


Reply to discussion (solution)

You can have multiple class definitions act on the node. If there are the same attributes, the later ones will overwrite the previous ones.

allows multiple class definitions to act on the node. If they have the same attributes, the latter one will overwrite the previous one.


I just tested it and it does work, but I have a question, can this be done only by using classes? It seems that it cannot be overwritten using id
<style type="text/css">    .m{background-color: red;}    .xj{background-color: blue;}    .xskd{background-color: mediumaquamarine;}</style><div class="m xj xskd">    <p>Hello</p></div>
Copy after login

Related labels:
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template