Home > Article > Web Front-end > Regarding the problem that subclasses do not want to inherit from parent classes_html/css_WEB-ITnose
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:
1481f40c56b2ee74b2b6100becce271f
< ;li>ee7959cc8dd4be16ef633321c03dac32Company Profile5db79b134e9f6b82c0b36e0489ee08ed
ff6d136ddc5fdfeffaf53ff6ee95f185
25edfb22a4f469ecb59f1190150159c6ee7959cc8dd4be16ef633321c03dac32Company Profilef069541765b1aee89c028e2166bdb03c
25edfb22a4f469ecb59f1190150159c6ee7959cc8dd4be16ef633321c03dac32Company Profile5db79b134e9f6b82c0b36e0489ee08ed05f4b0de0f967effc4e7765456c0618bee7959cc8dd4be16ef633321c03dac32Corporate Culture5db79b134e9f6b82c0b36e0489ee08ed6d267e5fab17ea8bc578f9e7e5e1570b
861f448a2c47375a88adcb954dabc953ee7959cc8dd4be16ef633321c03dac32Honorary Qualifications4a11e5928b3688cf38c9163b657eb5ac
818516a2aea8c5412fd444e4ed52d34a
25edfb22a4f469ecb59f1190150159c6ee7959cc8dd4be16ef633321c03dac32Honorary Qualification5db79b134e9f6b82c0b36e0489ee08ed6d267e5fab17ea8bc578f9e7e5e1570b
25edfb22a4f469ecb59f1190150159c6e99154396dac63cf45c677ecf72df8a3Honorary Qualifications5db79b134e9f6b82c0b36e0489ee08ed6d267e5fab17ea8bc578f9e7e5e1570b
929d1f5ca49e04fdcb27f9465b944689
6d267e5fab17ea8bc578f9e7e5e1570b
861f448a2c47375a88adcb954dabc953ee7959cc8dd4be16ef633321c03dac32Talent Recruitment5db79b134e9f6b82c0b36e0489ee08ed6d267e5fab17ea8bc578f9e7e5e1570b
25edfb22a4f469ecb59f1190150159c6 ee7959cc8dd4be16ef633321c03dac32Customer message5db79b134e9f6b82c0b36e0489ee08ed8ea5c00e07311317861051aff957a68eContact us5db79b134e9f6b82c0b36e0489ee08ed6d267e5fab17ea8bc578f9e7e5e1570b
929d1f5ca49e04fdcb27f9465b944689
.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)
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>