Home > Web Front-end > HTML Tutorial > 求助:如何让链接成块显示?_html/css_WEB-ITnose

求助:如何让链接成块显示?_html/css_WEB-ITnose

WBOY
Release: 2016-06-21 09:39:36
Original
1463 people have browsed it

如下:设置了#menu ul li a { display:block;} 按讲鼠标移到区域的时候,背景色就变化的,为啥现在必须把鼠标移到文字上,li的背景色才变呢?

#menu a:link {color:#666; text-decoration:none;}
#menu a:visited {color:#666;text-decoration:none;}
#menu a:hover {color:#ffffff;text-decoration:none;font-weight:bold;}
#menu a:active {color:#ffffff;text-decoration:none;font-weight:bold;}

#menu ul li { background: #eef;  border-bottom: 1px solid #CCC; float:left;}
#menu ul li a { display:block; height: 38px; width:168px; line-height: 38px; float:left;}
#menu ul li a:hover { background:#3ab3ec; font-size:14px; font-weight:bold;}
#menu ul li a:active { background:#3ab3ec; font-size:14px; font-weight:bold;}

回复讨论(解决方案)

找到原因了。因为有两个套在一起的DIV都被设置绝对位置了。导致全网页的很多元素都不正常。

呵呵,楼主真可爱

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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template