Home  >  Article  >  Web Front-end  >  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
WBOYOriginal
2016-06-24 12:01:092011browse

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

<div class="path cl"></div>

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>

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