css精灵,滑动门

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
<style>
.btn{width:100px;background:url(img/btn.png) repeat-x;}
.btnL{background:url(img/btnL.png) no-repeat;}
.btnR{height:31px; background:url(img/btnR.png) no-repeat right 0;}
</style>
</head>
<body>
<div class="btn">
	<div class="btnL">
    	<div class="btnR">妙味课堂</div>
    </div>
     
</div>
</body>
</html>

div是一层覆盖一层。先放背景,再覆盖上左边圆角,最后覆盖右边圆角。


<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
<style>
.btn{width:200px;background:url(img/btn2.png) no-repeat;}
.btnR{height:31px; background:url(img/btnR.png) no-repeat right 0;}
/*
	扩展要求高,图片比较大的 用三层嵌套
	扩展要求不高,图片比较小的 用两层嵌套
*/
</style>
</head>
<body>
<div class="btn">
	<div class="btnR">妙味课堂</div>
</div>
</body>
</html>

border-radius圆角大小




先左右后中间



2个css精灵,background-position不太懂,div内嵌叠加不太懂

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
<style>
.box{width:300px;margin:30px auto;}
.boxHead,.boxHeadL,.boxHeadR,.boxFoot,.boxFootL,.boxFootR{background:url(img2/ico.gif) no-repeat;}
.boxHead,.boxFoot{height:9px;overflow:hidden; background-repeat:repeat-x;}
.boxHeadL{ background-position:0 -9px;}/*第一个值是水平位置,第二个值是垂直位置。放在最左边并向上移动9px*/
.boxHeadR{height:9px;background-position:right -18px;}/*放在最右边并向上移动18px*/
.boxFoot{background-position:0 -27px;}
.boxFootL{ background-position:0 -36px;}
.boxFootR{height:9px;background-position:right -45px;}
.boxC{border-left:1px solid #e5e5e5;border-right:1px solid #e5e5e5;}
</style>
</head>
<body>
<div class="box">
	<div class="boxHead">
    	<div class="boxHeadL">
        	<div class="boxHeadR"></div>
        </div>
    </div>
    <div class="boxC">
    	  页面内容页面内容页面内容页面内容页面内容页面内容页面内容页面内容页面内容页面内容页面内容页面内容页面内容页面内容页面内容<br/>
          页面内容<br/>
          页面内容<br/>
          页面内容<br/>
          页面内容<br/>
          页面内容<br/>
          页面内容<br/>
          页面内容<br/>
          页面内容<br/>
          页面内容<br/>
          页面内容<br/>
          页面内容<br/>
    </div>
    <div class="boxFoot">
    	<div class="boxFootL">
        	<div class="boxFootR"></div>
        </div>
    </div>
</div>
</body>
</html>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
<style>
div{width:80px;height:80px;background:url(bigptr.jpg) no-repeat;border:10px solid #000;float:left;margin:10px; display:inline;}
.box1{ background-position:-151px -66px;}
.box2{ background-position:-241px -118px;}
.box3{ background-position:right bottom;}
</style>
</head>
<body>
<div class="box1"></div>
<div class="box2"></div>
<div class="box3"></div>
</body>
</html>



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
<style type="text/css"> body{ color: #000; font-family: "宋体", arial; font-size: 12px; background: #fff; text-align: center; margin: 0; } .nTab{ float: left; width: 240px; margin: 0 auto; border-bottom:1px #C7C7CD solid; background:#d5d5d5; background-position:left; background-repeat:repeat-y; margin-bottom:2px; } .nTab .TabTitle{ clear: both; height: 26px; overflow: hidden; } .nTab .TabTitle ul{ margin:0; padding:0; } .nTab .TabTitle li{ float: left; width: 60px; cursor: pointer; padding-top: 6px; padding-right: 0px; padding-left: 0px; padding-bottom: 7px; list-style-type: none; } .nTab .TabTitle .active{ background:url(images/finance_nc_080124_ws_001.gif) left -25px no-repeat;border-left:1px #C7C7CD solid;border-top:1px #C7C7CD solid;border-bottom:1px #fff solid;} .nTab .TabTitle .normal{ background:url(images/finance_nc_080124_ws_001.gif);border-top:1px #C7C7CD solid;border-bottom:1px #C7C7CD solid;} .nTab .TabContent{ width:auto;background:#fff; margin: 0px auto; padding:10px 0 0 0; border-right:1px #C7C7CD solid;border-left:1px #C7C7CD solid; } .none {display:none;} </style> <script type="text/javascript"> function nTabs(thisObj,Num){ if(thisObj.className == "active")return; var tabObj = thisObj.parentNode.id; var tabList = document.getElementById(tabObj).getElementsByTagName("li"); for(i=0; i <tabList.length; i++) { if (i == Num) { thisObj.className = "active"; document.getElementById(tabObj+"_Content"+i).style.display = "block"; }else{ tabList[i].className = "normal"; document.getElementById(tabObj+"_Content"+i).style.display = "none"; } } } </script> <!-- 选项卡开始 --> <div class="nTab"> <!-- 标题开始 --> <div class="TabTitle"> <ul id="myTab0"> <li class="active" onClick="nTabs(this,0);">预拔电杆</li> <li class="normal" onClick="nTabs(this,1);">预等电杆</li> <li class="normal" onClick="nTabs(this,2);">普拔电杆</li> <li class="normal" onClick="nTabs(this,3);">部预电杆</li> </ul> </div> <!-- 内容开始 --> <div class="TabContent"> <div id="myTab0_Content0"> 欢迎访问:<a href="http://www.alixixi.com" target="_blank">阿里西西WEB开发 </a></div> <div id="myTab0_Content1" class="none"><a href="http://www.alixixi.com">计源论坛 计源论坛</a></div> <div id="myTab0_Content2" class="none"><a href="http://www.alixixi.com">计源论坛22</a></div> <div id="myTab0_Content3" class="none"><a href="http://www.alixixi.com">计源论坛33</a></div> </div> </div> <!-- 选项卡结束 -->

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值