求大神帮忙看看网页换肤代码怎么写?头部id="cssfile"不知道怎么用这个~ 70
<linkhref="css/skin_0.css"rel="stylesheet"type="text/css"id="cssfile"><styletype="tex...
<link href="css/skin_0.css" rel="stylesheet" type="text/css" id="cssfile">
<style type="text/css">
*{ margin:0 auto; padding:0;}
.clearfix{ zoom:1;}
.clearfix:after{ clear:both; display:block; content:""; height:0px; overflow:hidden;}
ul{ width:600px; height:60px; border:1px solid #ccc; margin-top:50px;}
ul li{ width:30px; height:30px; margin:15px; display:block; float:left; cursor:pointer;}
#skin_0{ background:#ccc;}
#skin_1{ background:#C9F;}
#skin_2{ background:#F9C;}
#skin_3{ background:#69F;}
#skin_4{ background:#F60;}
#skin_5{ background:#3C0;}
.con{ width:600px; background:#ccc; height:100px;}
#div_side{ width:100px; height:40px; line-height:40px; text-align:center; float:left; margin-right:30px;}
h1{ font-size:20px; font-weight:normal;}
.selected{ opacity:0.6;}
</style>
<body>
<ul id="skin">
<li id="skin_0" title="灰色" class="selected"></li>
<li id="skin_1" title="紫色"></li>
<li id="skin_2" title="红色"></li>
<li id="skin_3" title="蓝色"></li>
<li id="skin_4" title="橙色"></li>
<li id="skin_5" title="绿色"></li>
</ul>
<div class="con">
<div id="div_side">
<h1 class="title">时事新闻</h1>
</div>
<div id="div_side">
<h1 class="title">娱乐新闻</h1>
</div>
</div>
<script type="text/javascript" src="../js/jQuery.js"></script>
<script src="jquery.cookie.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
var $li=$("#skin li");
$li.click(function(){
$("#"+this.id).addClass("selected")
.siblings().removeClass("selected");
$("#cssfile").attr("href","css/"+this.id+".css");
});
});
</script>
</body> 展开
<style type="text/css">
*{ margin:0 auto; padding:0;}
.clearfix{ zoom:1;}
.clearfix:after{ clear:both; display:block; content:""; height:0px; overflow:hidden;}
ul{ width:600px; height:60px; border:1px solid #ccc; margin-top:50px;}
ul li{ width:30px; height:30px; margin:15px; display:block; float:left; cursor:pointer;}
#skin_0{ background:#ccc;}
#skin_1{ background:#C9F;}
#skin_2{ background:#F9C;}
#skin_3{ background:#69F;}
#skin_4{ background:#F60;}
#skin_5{ background:#3C0;}
.con{ width:600px; background:#ccc; height:100px;}
#div_side{ width:100px; height:40px; line-height:40px; text-align:center; float:left; margin-right:30px;}
h1{ font-size:20px; font-weight:normal;}
.selected{ opacity:0.6;}
</style>
<body>
<ul id="skin">
<li id="skin_0" title="灰色" class="selected"></li>
<li id="skin_1" title="紫色"></li>
<li id="skin_2" title="红色"></li>
<li id="skin_3" title="蓝色"></li>
<li id="skin_4" title="橙色"></li>
<li id="skin_5" title="绿色"></li>
</ul>
<div class="con">
<div id="div_side">
<h1 class="title">时事新闻</h1>
</div>
<div id="div_side">
<h1 class="title">娱乐新闻</h1>
</div>
</div>
<script type="text/javascript" src="../js/jQuery.js"></script>
<script src="jquery.cookie.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
var $li=$("#skin li");
$li.click(function(){
$("#"+this.id).addClass("selected")
.siblings().removeClass("selected");
$("#cssfile").attr("href","css/"+this.id+".css");
});
});
</script>
</body> 展开
展开全部
skin_0{ background:#ccc;}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询