<a href="#" class=""></a> class背景定位问题
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>rili</title>
<style type="text/css">
ul { margin:0; padding:0; }
li { list-style:none;}
.tbcon {float:left;width:230px; height:230px; padding:5px;}
.tbcon ul li {float:left;width:33px; margin-top:7px; padding-left:5px;}
.tbcon ul li a {float:left;width:27px; height:21px; background:url(http://www.b2cedu.com/zz/images1/rilipic.gif) no-repeat; text-indent:-9999px;}
.tbcon ul li a:hover { background-position:0 -62px;}
.tbcon ul li a .2yue { background-position:-37px 0; }
.tbcon ul li a .3yue { background-position:-74px 0; }
.tbcon ul li a .4yue { background-position:-111px 0; }
.tbcon ul li a .5yue { background-position:-148px 0; }
.tbcon ul li a .6yue { background-position:-185px 0; }
.tbcon ul li a .2yue { background-position:-37px -31px; }
.tbcon ul li a .3yue { background-position:-74px -31px; }
.tbcon ul li a .4yue { background-position:-111px -31px }
.tbcon ul li a .5yue { background-position:-148px -31px; }
.tbcon ul li a .6yue { background-position:-185px -31px; }
.tbcon ul li a:hover .2yue { background-position:-37px -62px; }
.tbcon ul li a:hover .3yue { background-position:-74px -62px; }
.tbcon ul li a:hover .4yue { background-position:-111px -62px; }
.tbcon ul li a:hover .5yue { background-position:-148px -62px; }
.tbcon ul li a:hover .6yue { background-position:-185px -62px; }
.tbcon ul li a:hover .2yue { background-position:-37px -93px; }
.tbcon ul li a:hover .3yue { background-position:-74px -93px; }
.tbcon ul li a:hover .4yue { background-position:-111px -93px }
.tbcon ul li a:hover .5yue { background-position:-148px -93px; }
.tbcon ul li a:hover .6yue { background-position:-185px -93px; }
</style>
</head>
<body>
<div id="0" class=" tbcon" style="display: block; ">
<ul>
<li><a href="#" class="1yue">一月</a></li>
<li><a href="#" class="2yue">二月</a></li>
<li><a href="#" class="3yue">三月</a></li>
<li><a href="#" class="4yue">四月</a></li>
<li><a href="#" class="5yue">五月</a></li>
<li><a href="#" class="6yue">六月</a></li>
<li><a href="#" class="7yue">七月</a></li>
<li><a href="#" class="8yue">八月</a></li>
<li><a href="#" class="9yue">九月</a></li>
<li><a href="#" class="10yue">十月</a></li>
<li><a href="#" class="11yue">十一月</a></li>
<li><a href="#" class="12yue">十二月</a></li>
</ul>
</div>
</body>
</html>
大家帮我看看 a标签里的class样式怎样写才起作用。。。。。 展开
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>rili</title>
<style type="text/css">
ul { margin:0; padding:0; }
li { list-style:none;}
.tbcon {float:left;width:230px; height:230px; padding:5px;}
.tbcon ul li {float:left;width:33px; margin-top:7px; padding-left:5px;}
.tbcon ul li a {float:left;width:27px; height:21px; background:url(http://www.b2cedu.com/zz/images1/rilipic.gif) no-repeat; text-indent:-9999px;}
.tbcon ul li a:hover { background-position:0 -62px;}
.tbcon ul li a .2yue { background-position:-37px 0; }
.tbcon ul li a .3yue { background-position:-74px 0; }
.tbcon ul li a .4yue { background-position:-111px 0; }
.tbcon ul li a .5yue { background-position:-148px 0; }
.tbcon ul li a .6yue { background-position:-185px 0; }
.tbcon ul li a .2yue { background-position:-37px -31px; }
.tbcon ul li a .3yue { background-position:-74px -31px; }
.tbcon ul li a .4yue { background-position:-111px -31px }
.tbcon ul li a .5yue { background-position:-148px -31px; }
.tbcon ul li a .6yue { background-position:-185px -31px; }
.tbcon ul li a:hover .2yue { background-position:-37px -62px; }
.tbcon ul li a:hover .3yue { background-position:-74px -62px; }
.tbcon ul li a:hover .4yue { background-position:-111px -62px; }
.tbcon ul li a:hover .5yue { background-position:-148px -62px; }
.tbcon ul li a:hover .6yue { background-position:-185px -62px; }
.tbcon ul li a:hover .2yue { background-position:-37px -93px; }
.tbcon ul li a:hover .3yue { background-position:-74px -93px; }
.tbcon ul li a:hover .4yue { background-position:-111px -93px }
.tbcon ul li a:hover .5yue { background-position:-148px -93px; }
.tbcon ul li a:hover .6yue { background-position:-185px -93px; }
</style>
</head>
<body>
<div id="0" class=" tbcon" style="display: block; ">
<ul>
<li><a href="#" class="1yue">一月</a></li>
<li><a href="#" class="2yue">二月</a></li>
<li><a href="#" class="3yue">三月</a></li>
<li><a href="#" class="4yue">四月</a></li>
<li><a href="#" class="5yue">五月</a></li>
<li><a href="#" class="6yue">六月</a></li>
<li><a href="#" class="7yue">七月</a></li>
<li><a href="#" class="8yue">八月</a></li>
<li><a href="#" class="9yue">九月</a></li>
<li><a href="#" class="10yue">十月</a></li>
<li><a href="#" class="11yue">十一月</a></li>
<li><a href="#" class="12yue">十二月</a></li>
</ul>
</div>
</body>
</html>
大家帮我看看 a标签里的class样式怎样写才起作用。。。。。 展开
2个回答
展开全部
class名称不能以数字开头,帮你修了一部分,看看:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>rili</title>
<style type="text/css">
ul { margin:0; padding:0; }
li { list-style:none;}
.tbcon {float:left;width:230px; height:230px; padding:5px;}
.tbcon ul li {float:left;width:33px; margin-top:7px; padding-
left:5px;}
.tbcon ul li a.yue2 { background-position:-37px 0; }
.tbcon ul li a.yue3 { background-position:-74px 0; }
.tbcon ul li a.yue4 { background-position:-111px 0; }
.tbcon ul li a.yue5 { background-position:-148px 0; }
.tbcon ul li a.yue6 { background-position:-185px 0; }
.tbcon ul li a.yue7 { background-position:-37px -31px; }
.tbcon ul li a.yue8 { background-position:-74px -31px; }
.tbcon ul li a.yue9 { background-position:-111px -31px }
.tbcon ul li a.yue10 { background-position:-148px -31px; }
.tbcon ul li a.yue11 { background-position:-185px -31px; }
.tbcon ul li a.yue2:hover { background-position:-37px -62px; }
.tbcon ul li a.yue3:hover { background-position:-74px -62px; }
.tbcon ul li a.yue4:hover { background-position:-111px -62px; }
.tbcon ul li a.yue5:hover { background-position:-148px -62px; }
.tbcon ul li a.yue6:hover { background-position:-185px -62px; }
.tbcon ul li a.yue7:hover { background-position:-37px -93px; }
.tbcon ul li a.yue8:hover { background-position:-74px -93px; }
.tbcon ul li a.yue9:hover { background-position:-111px -93px }
.tbcon ul li a.yue10:hover { background-position:-148px -93px; }
.tbcon ul li a.yue11:hover { background-position:-185px -93px; }
.tbcon ul li a {float:left;width:27px; height:21px; background:url
(http://www.b2cedu.com/zz/images1/rilipic.gif) no-repeat; text-
indent:-9999px;}
.tbcon ul li a:hover { background-position:0 -62px;}
</style>
</head>
<body>
<div id="0" class="tbcon" style="display: block; ">
<ul>
<li><a href="#" class="yue1">一月</a></li>
<li><a href="#" class="yue2">二月</a></li>
<li><a href="#" class="yue3">三月</a></li>
<li><a href="#" class="yue4">四月</a></li>
<li><a href="#" class="yue5">五月</a></li>
<li><a href="#" class="yue6">六月</a></li>
<li><a href="#" class="yue7">七月</a></li>
<li><a href="#" class="yue8">八月</a></li>
<li><a href="#" class="yue9">九月</a></li>
<li><a href="#" class="yue10">十月</a></li>
<li><a href="#" class="yue11">十一月</a></li>
<li><a href="#" class="yue12">十二月</a></li>
</ul>
</div>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>rili</title>
<style type="text/css">
ul { margin:0; padding:0; }
li { list-style:none;}
.tbcon {float:left;width:230px; height:230px; padding:5px;}
.tbcon ul li {float:left;width:33px; margin-top:7px; padding-
left:5px;}
.tbcon ul li a.yue2 { background-position:-37px 0; }
.tbcon ul li a.yue3 { background-position:-74px 0; }
.tbcon ul li a.yue4 { background-position:-111px 0; }
.tbcon ul li a.yue5 { background-position:-148px 0; }
.tbcon ul li a.yue6 { background-position:-185px 0; }
.tbcon ul li a.yue7 { background-position:-37px -31px; }
.tbcon ul li a.yue8 { background-position:-74px -31px; }
.tbcon ul li a.yue9 { background-position:-111px -31px }
.tbcon ul li a.yue10 { background-position:-148px -31px; }
.tbcon ul li a.yue11 { background-position:-185px -31px; }
.tbcon ul li a.yue2:hover { background-position:-37px -62px; }
.tbcon ul li a.yue3:hover { background-position:-74px -62px; }
.tbcon ul li a.yue4:hover { background-position:-111px -62px; }
.tbcon ul li a.yue5:hover { background-position:-148px -62px; }
.tbcon ul li a.yue6:hover { background-position:-185px -62px; }
.tbcon ul li a.yue7:hover { background-position:-37px -93px; }
.tbcon ul li a.yue8:hover { background-position:-74px -93px; }
.tbcon ul li a.yue9:hover { background-position:-111px -93px }
.tbcon ul li a.yue10:hover { background-position:-148px -93px; }
.tbcon ul li a.yue11:hover { background-position:-185px -93px; }
.tbcon ul li a {float:left;width:27px; height:21px; background:url
(http://www.b2cedu.com/zz/images1/rilipic.gif) no-repeat; text-
indent:-9999px;}
.tbcon ul li a:hover { background-position:0 -62px;}
</style>
</head>
<body>
<div id="0" class="tbcon" style="display: block; ">
<ul>
<li><a href="#" class="yue1">一月</a></li>
<li><a href="#" class="yue2">二月</a></li>
<li><a href="#" class="yue3">三月</a></li>
<li><a href="#" class="yue4">四月</a></li>
<li><a href="#" class="yue5">五月</a></li>
<li><a href="#" class="yue6">六月</a></li>
<li><a href="#" class="yue7">七月</a></li>
<li><a href="#" class="yue8">八月</a></li>
<li><a href="#" class="yue9">九月</a></li>
<li><a href="#" class="yue10">十月</a></li>
<li><a href="#" class="yue11">十一月</a></li>
<li><a href="#" class="yue12">十二月</a></li>
</ul>
</div>
</body>
</html>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询