你这个要直接a:hover span时设为block
<ul id="test">
<li><a href="#">移到这里<span>提示内容</span></a></li>
<ul>
#test a span{display:none}
#test a:hover span{display:block}
IE6下a:hover span是无效的,不过很好解决,你自行百度下ie6 a:hover span
使用DIV+css 实现文字横排居中 并且有间距,首先文字需要有个块级元素包裹着,然后设定一定的宽度和高度,文字居中,css中有个text-align这个属性,设置成center,文字就是相对容器的宽度是居中的,请看代码:<html>
<head>
<style>
#div1{
width:600px
height:40px
font-size:13px
}
#div1 p{
display:block
width:300px
height:30px
text-align:center
margin:0 auto
}
</head>
<body>
<div id='div1'>
<p>我是测试文字</p>
</div>
</body>
</html>
做了一个导航横向代码里面的鼠标未移上去时的字体怎么也改不了颜色和大小希望高手帮个忙看看怎么改CSS代码:#top1
{
WIDTH:
969px}/*---------------------页面基础定义----------------------------------*/body,td,th
{
font-family:
Tahoma,
Verdana,
Arial,
sans-serif
font-size:
12px
color:
#000000}body
{
margin-left:
0px
margin-top:
0px
margin-right:
0px
margin-bottom:
0px}/*---------------------链接定义----------------------------------*/a
{
color:
#FFFFFF
text-decoration:
none}a:hover
{
color:
#000000
text-decoration:
none}a:active{
color:
#FF0000
text-decoration:
none}/*---------------------菜单样式----------------------------------*/#menu{
height:32px
margin-top:1px
background-color:#90D311}#menu
ul{
margin:auto
width:778px
height:32px
list-style-type:none
padding:0px
margin-top:0px
margin-bottom:0px}.m_li{
float:left
width:88px
line-height:32px
text-align:center
margin-right:-2px
margin-left:-2px}.m_li
a:link{
display:block
color:#FFFFFF
width:85px}.m_line{
float:left
width:1px
height:32px
line-height:32px
/*ff下有效(图片垂直居中)*/}.m_line
img{
margin-top:expression((
32
-
this.height
)
/
2)
/*ie下有效(图片垂直居中)*/}.m_li_a{
float:left
width:85px
line-height:32px
text-align:center
padding-top:3px
font-weight:bold
background-image:url(
http://127.0.0.1/daohang/images/menu_bg.JPG
)
position:relative
height:32px
margin-top:-3px
margin-right:-2px
margin-left:-2px}.m_li_a
a{
display:block
color:#FF0000
width:85px}.smenu{
width:810x
margin:0px
auto
0px
auto
padding:0px
list-style-type:none
height:32px
FLOAT:
left}.s_li{
line-height:32px
FLOAT:
left
width:auto
display:none
height:32px
}.s_li_a{
line-height:32px
width:auto
display:block
height:32px
FLOAT:
left}