Home >
Web Front-end >
HTML Tutorial >
Regarding the problem that subclasses do not want to inherit from parent classes_html/css_WEB-ITnose
Regarding the problem that subclasses do not want to inherit from parent classes_html/css_WEB-ITnose
WBOY
Release: 2016-06-24 12:21:46
Original
1773 people have browsed it
In the style, there is a problem about subclasses inheriting the parent class. Now we don’t want the subclass to inherit the style of the parent class, and then the dynamically generated html is like this:
.menu>li>ul>li If written like this, other browsers can achieve the purpose, but it will not work under IE6 , if not written like this, the ulli of the second loop will inherit the previous style. How to solve it?
Reply to the discussion (solution) .menu>li The parent class should also be written like this
.menu>li The parent class should also be written like this
If the parent class is written like this, it can be used except for IE6
Is this what you mean?
I don’t understand why you don’t write like this .menu ul li ul li{}
<style type="text/css"> ul.menu a{ color:#f00; } ul.menu ul a { color:green; } </style>
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