Home > Article > Web Front-end > Questions about repeated CSS definition_html/css_WEB-ITnose
If the styles for UL and LI have been defined in the external CSS file:
Then on the current page, I will define another style and apply it to the ff6d136ddc5fdfeffaf53ff6ee95f185 2725bc59dc72971ec020c7c0c6672165, is it invalid?
External css style and internal css style exist at the same time, and the internal css style shall prevail.
The internal css style and the style attribute of the tag exist at the same time, and the style of the style attribute shall prevail.
The situation you mentioned should be that both will be valid, but the CSS class has a higher priority. If the same style attribute exists, the style defined in the CSS class will override the ul li style.
CSS priority: http://spemoon.github.com/blog/2011/09/06/css-priority/
In the situation you mentioned, both should be valid, but CSS Classes have higher priority. If the same style attributes exist, the styles defined in the CSS class will override the ulli style.
CSS priority: http://spemoon.github.com/blog/2011/09/06/css-priority/
I define it in external CSS like this:
ul#navmenu li:hover li a,ul#navmenu li.iehover li a { float: none; background:#6699CC; color:#FFFFFF; border-bottom:#FFFFFF solid 1px; text-align:left; padding-left:10px; width:180px; }ul#navmenu li:hover li a:hover,ul#navmenu li:hover li:hover a,ul#navmenu li.iehover li a:hover,ul#navmenu li.iehover li.iehover a { background:#99CC00; color:#FFFFFF;}
<style>style2{ background:#000000;}</style>
.style2{
background:#000000;
}
A period is missing.
.style2{
background:#000000;
}
A period is missing.
I fainted and made another stupid mistake. Thank you so much! Distribute points now! ! !