为什么不能改变子菜单的字体颜色?_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:09:51
Original
1362 people have browsed it



#menu { padding:0px; position:absolute; margin:0 auto; height:26px; /*background:#ABC;*/ top:110px; width:960px; left:15%; z-index:990;}#menu ul{ margin:0 auto; position:absolute; /*background:#00FF00;*/ list-style:none; padding:0px; height:26px; line-height:26px;}#menu ul li{ float:left; padding:0px; height:26px; line-height:26px;}#menu ul li a { color:#7777CC; display:block; padding:0px 27px; height:26px; line-height:26px; float:left;}#menu ul li a:hover { background:#7777CC; color:#EEE;}#menu #submenu { position:absolute; padding:0px; float:left; top:26px; width:600px; height:54px; display:block; background-color:#AAB;}.subitem { width:600px; color:#FF0000;}
Copy after login

代码如上,submenu继承了menu的字体颜色,无法独立定义


回复讨论(解决方案)

#menu .subitem a{
color:#FF0000;
}
这样就行了

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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!