背景图、背景颜色,精灵图的学习应用
实例
html>
精灵图的应用*{margin: 0;padding: 0;}
div{
margin: 50px auto;
width: 100px;
height: 100px;
}
.pic1{
background: url(static/images/p2.jpg) -300px -340px;
}
.pic2{
background: url(static/images/p2.jpg) -320px -470px;
}
运行实例 »
点击 "运行实例" 按钮查看在线实例
表格的学习应用以及无序列表
实例
html>
表格实例*{margin: 40px auto;padding: 0;}
table{
width: 500px;
margin: 0 auto;
border: 2px solid #ccc;
border-collapse: collapse; /*折叠边框*/
background: rgba(255,0,0,0.1);
}
td{
border: 1px solid #ccc;
text-align: center;
height: 20px; /*行高*/
}
div{
width: 500px;
background: linear-gradient(to top,rgba(255,0,0,0.1),blue);
}
li{
list-style: none;
}
成绩表 | |||||
姓名 | 数学 | 语文 | 英语 | 地理 | 历史 |
张三 | |||||
李四 | |||||
王二 |
- 第一名:
- 第二名:
- 第三名:
运行实例 »
点击 "运行实例" 按钮查看在线实例
表单的综合运用
实例
html>
登录页面*{margin: 0;padding: 0;}
body{
background: url(static/images/3.jpg) no-repeat;
/*background-size: 50%;*/
}
div{
width: 400px;
height: 350px;
margin: 200px auto;
background: linear-gradient(to bottom,rgb(255,85,45),rgb(23,62,129));
border-radius: 10px;
text-align: center;
font-size: 12px;
border: 1px dashed #000;
box-shadow: 2px 2px 40px #ccc;
}
img{
width: 100px;
/*height: 100px;*/
margin-top: 40px;
border-radius: 50%;
}
input{
width: 300px;
height: 30px;
margin-top: 15px;
border-radius: 6px;
border:none; /*去掉自带边框*/
padding-left: 15px;
}
p{
line-height: 15px;
/*font-size: 14px;*/
}
button{
border:none;
width: 140px;
height: 30px;
margin:10px 15px;
border-radius: 6px;
background-color: #ccc;
color: #fff;
}
记住账号密码忘记密码
注册
登录
>
运行实例 »
点击 "运行实例" 按钮查看在线实例
学习笔记
心得:加深理解块元素和行内元素的区别、联系;