使用DIV UL LI做一效果,鼠标没移上去LI的样式都是很普通的,当鼠标移上去之后就变成如下图的样式:请问大家这个怎么做?谢谢了!!!
解决方案 »
- 更换系统的主题皮肤应该怎么做呢?
- javascript能否做到直接将字符串插入到select里面去啊
- 一个Firefox兼容性问题,很简单。解决马上结贴
- 判断两个隔开的字符串相等问题,高手进来呀!
- 请问:网页传送数据如果要实现SSL128位加密,怎么做?
- 请教:如何修改下面代码以使POPUP中的关闭生效。。
- 调用dsoframer.ocx 无效的过程调用或参数
- js 给textbox追加值
- jquery 或jquery mobile实现限制Input只能输入指定字符
- 如何让网页只能用本机的IE打开,并且打开的窗口尺寸是指定的,在屏幕上水平和垂直居中
- window.event.keyCode = 0;是什么意思呀?
- 请教正则有办法replace指定个数吗
但是打不开
dom.className=c1
类似这种代码。
<style type="text/css">
#newslist a{color:#FF0000; width:350px; padding:5px; display:block; font-size:12px; position:relative;}
#newslist a:hover{border:1px solid #4785ac; background:#daf1ff; text-decoration:none;}
#newslist a span{position:absolute; right:5px;}
</style>
<div id="newslist">
<a href="#">阿里西西,web开发之家!<span>[2009-09-28]</span></a>
<a href="#">阿里西西,web开发之家!<span>[2009-09-28]</span></a>
</div>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript" language="javascript" src="jquery-1.3.2-vsdoc.js"></script>
<script type="text/javascript" language="javascript">
$(document).ready(function(){
$(".box ul li").hover(
function () {
$(this).addClass("box_li"); //鼠标经过时增加样式box_li
},
function () {
$(this).removeClass("box_li"); //鼠标离开时移除样式box_li
}
)
})
</script>
<style type="text/css">
.box{ width:250px; margin:0 auto; height:260px; border:1px solid #090; font-size:12px;}
.box ul{ margin:0px; padding:20px 0 0 0;}
.box ul li{ height:25px; line-height:25px; list-style:none; margin-left:20px; list-style-image:url(a.gif);}
.box_li{height:25px; line-height:25px; list-style:none; border:1px solid #090; background:#3FF;}
</style>
</head><body>
<div class="box">
<ul>
<li><a href="#">文字文字文字文字</a></li>
<li><a href="#">文字文字文字文字</a></li>
<li><a href="#">文字文字文字文字</a></li>
<li><a href="#">文字文字文字文字</a></li>
<li><a href="#">文字文字文字文字</a></li>
<li><a href="#">文字文字文字文字</a></li>
<li><a href="#">文字文字文字文字</a></li>
<li><a href="#">文字文字文字文字</a></li>
<li><a href="#">文字文字文字文字</a></li>
</ul>
</div>
</body>
</html>
<style type="text/css">
#newslist{list-style:none; padding:0; margin:0;}
#newslist a{color:#FF0000; width:350px; padding:5px; display:block; font-size:12px; position:relative; text-decoration:none;}
#newslist a:hover{border:1px solid #4785ac; background:#daf1ff;}
#newslist a span{position:absolute; right:5px;}
</style>
<ul id="newslist">
<li><a href="#">阿里西西,web开发之家!<span>[2009-09-28]</span></a></li>
<li><a href="#">阿里西西,web开发之家!<span>[2009-09-28]</span></a></li>
</ul>
这样写不行吗
<style type="text/css">
#newslist{list-style:none; padding:0; margin:0;}
#newslist a{color:#FF0000; width:350px; padding:5px; display:block; font-size:12px; position:relative; text-decoration:none;}
#newslist a:hover{border:1px solid #4785ac; background:#daf1ff url(http://preview.zcool.com.cn/pic/gif/gif_43/01/arrow_004.gif) no-repeat 7px center; padding-left:20px;}
#newslist a span{position:absolute; right:5px;}
</style>
<ul id="newslist">
<li><a href="#">阿里西西,web开发之家!<span>[2009-09-28]</span></a></li>
<li><a href="#">阿里西西,web开发之家!<span>[2009-09-28]</span></a></li>
</ul>
加个小图片也不难吧