前端第一 php第二,0312前端知识第二课

论坛 期权论坛 编程之家     
选择匿名的用户   2021-5-24 08:44   708   0

背景图、背景颜色,精灵图的学习应用

实例

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;

}

记住账号密码忘记密码

注册

登录

>

运行实例

点击 "运行实例" 按钮查看在线实例

学习笔记

心得:加深理解块元素和行内元素的区别、联系;

b9f70c66e72d479266d82c3780214799.png

8acf20c6979fd00f70e7233f84370acc.png

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP