(一)实现简单的淘宝带图标侧边栏效果

 <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<style>
ul,h3{padding: 0;margin:0;
list-style: none;
font-size: 14px;
font-weight: 400}
.cat{width:150px;
background-color: #f8f8f8;
border: 1px solid #bbb;}
li{line-height: 31px;
height: 31px;
border-bottom: 1px solid #dedede;
overflow: hidden;}
li i{background:url(sidebar.png);
display: inline;
width: 30px;
height: 40px;
float: left;
margin-top:6px;
margin-left:25px;
}
.cat-1 i{background-position: 0 0;}
.cat-2 i{background-position: 0 -24px;}
.cat-3 i{background-position: 0 -48px;}
.cat-4 i{background-position: 0 -72px;}
.cat-5 i{background-position: 0 -96px;}
.cat-6 i{background-position: 0 -120px;}
.cat-7 i{background-position: 0 -144px;}
.cat-8 i{background-position: 0 -168px;}
.cat-9 i{background-position: -40px 0;}
</style>
<body>
<div class="cat">
<ul>
<li class="cat-1"><i></i><h3>服饰内衣</h3></li>
<li class="cat-2"><i></i><h3>鞋包配饰</h3></li>
<li class="cat-3"><i></i><h3>运动户外</h3></li>
<li class="cat-4"><i></i><h3>珠宝手表</h3></li>
<li class="cat-5"><i></i><h3>手机数码</h3></li>
<li class="cat-6"><i></i><h3>办公家电</h3></li>
<li class="cat-7"><i></i><h3>护肤彩妆</h3></li>
<li class="cat-8"><i></i><h3>母婴用品</h3></li>
<li class="cat-9"><i></i><h3>其他分类</h3></li>
</ul>
</div>
</body>
</html>

效果图:

(二)实现人人网登录页面(登录和提交按钮通过css sprite实现)

 <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>LOGIN</title>
<style>
input,p,span,ul,li{margin:0;padding: 0;}
.cat{width: 192px;
background-color:#EFFBFE;
padding-left: 15px;
position: relative;}
span{font-size: 14px;
font-weight: 400px;}
input{margin-top: 10px;}
.login{
width: 176px;
height: 32px;
text-indent: 2em;
font-size: 13px;
font-family:sans-serif;
border-radius: 3px;
border:1px solid #bbbbbb;}
a{text-decoration: none;}
hr{width:176px;margin-top: 14px;
position: absolute;left: 15px;}
p{font-size: 12px;
font-family: sans-serif;} /* input[type="button"]{
width:180px;height:38px;
border:0;margin-top:15px;
cursor:pointer;}*/ /*按钮如果不设置长宽的话则图标无法正常显示*/
.login_btn,.reg_btn{
width:180px;height:38px;
border:0;margin-top:15px;
cursor:pointer;}
.login_btn{background: url(http://img.mukewang.com/539a972b00013e9102280177.jpg);
background-position: 0 0;}
.reg_btn{background: url(http://img.mukewang.com/539a972b00013e9102280177.jpg);
background-position: 0 -38px;}
</style>
</head>
<body>
<div class="cat">
<form action="#" method="post">
<input type="text" class="login"placeholder="邮箱/手机号/用户名"/>
<input type="password" class="login" placeholder="请输入密码">
<br>
<p>
<input type="checkbox" class="auto" checked="">下次自动登录
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="#">忘记密码?</a>
</p>
<input type="button" class="login_btn"><br>
<hr>
<br>
<input type="button" class="reg_btn">
</form>
</div>
</body>
</html>

效果图:

参考:慕课网

最新文章

  1. Visual Studio 2013 Ultimate因为CodeLens功能导致Microsoft.Alm.Shared.Remoting.RemoteContainer.dll高CPU占用率的折中解决方案
  2. sublime text 输入法候选词不跟随光标
  3. 数据结构:单链表结构字符串(python版)改进
  4. 循序渐进Python3(十一) --6-- &#160;Ajax 实现跨域请求 jsonp 和 cors
  5. java程序操作Geometry对象
  6. Shell编程基础教程3--Shell输入与输出
  7. iOS- 微信支付 (服务器调起支付 )以及回调不成功的原因 不看后悔
  8. WPF Step By Step 完整布局介绍
  9. poj 3335 Rotating Scoreboard
  10. DB2数据库全系列版本安装介质下载地址
  11. ubuntu卸载vmware
  12. Java中修饰符
  13. linux下oracle启动关闭
  14. scrapy通过修改配置文件发送状态邮件
  15. 国庆JAVA作业
  16. NativeWindow_01_CreateWindow(Ex)_VC6
  17. spring MVC 使用 modelAndView.setViewName(&quot;forward:*.action&quot;) 发送重定向
  18. FragmentTransaction add 和 replace 区别 转
  19. 给上传文件的input控件“美容”
  20. Changing the Output Voltage of a Switching Regulator on the Fly

热门文章

  1. BZOJ3329 : Xorequ
  2. TYVJ P1063 数字串 Label:双指针 线性扫描
  3. 【BZOJ】2802: [Poi2012]Warehouse Store(贪心)
  4. 【wikioi】1229 数字游戏(dfs+水题)
  5. shadowColor表示阴影颜色,shadowBlur表示模糊等级
  6. memcached与spring
  7. HDU 3639 Bone Collector II(01背包第K优解)
  8. 移动Web应用开发入门指南——交互篇
  9. Linux下的mongodb分片部署
  10. 使用 Intel GPA 与 分析3D程序和抓取模型