HTML应用开发基础篇 - CSS3 新增特效

本文介绍了CSS3中的一些新增特效,包括边框效果(如圆角、阴影)、文字阴影、transform属性、图标字体的使用、动画的创建以及响应式布局的实现方法。通过实例展示,帮助开发者更好地理解和应用这些特性。
摘要由CSDN通过智能技术生成

目录

1、边框效果

1)、圆角属性

2)、边框阴影

3)、文字阴影

2、文字效果

3、transform 属性

4、图标字体

5、动画

6、响应式布局


 

1、边框效果

1)、圆角属性

border-radius ,赋值顺序是 上、右、下、左。

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			div{
				width:100px;
				height: 100px;
				border: 1px solid black;
				margin: 4px;
			}
			div:nth-of-type(1){
				border-radius: 12px 13px 14px 5px;
			}
			div:nth-of-type(2){
				border-radius: 22px ;
			}
			div:nth-of-type(3){
				border-radius: 22px 50px;
			}
			div:nth-of-type(4){
				border-radius: 50%;
			}
		</style>
	</head>
	<body>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
	</body>
</html>

2)、边框阴影

box-shadow : 水平阴影  垂直阴影  羽化值  阴影大小  阴影颜色  阴影类别(内部inset|外部outset)。

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			div{
				width:300px;
				height:100px;
				background-color:coral;
				box-shadow: 10px 10px 5px 1px gray;} 
			}
		</style>
	</head>
	<body>
		<div></div>
	</body>
</html>

做几个图:

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			div{
				width:100px;
				height: 100px;
				border: 1px solid black;
				margin: 4px;
			}
			div:nth-of-type(1){
				background: red;
				border-radius: 10%;
				box-shadow: 10px 10px 5px 2px gray;
			}
			div:nth-of-type(2){
				border:0px;
				border-bottom: green solid 50px;
				border-radius: 0px 0px 100px 0px;		
				-webkit-transform: scale(0.3,0.3);		
			}
			div:nth-of-type(3){
				width: 0px;
				height: 0px;
				/*background: blue;*/
				
				/*transparent : 表示背景透明*/
				border-top:30px solid transparent;
				border-left:30px solid red;
				border-bottom:30px solid transparent;
				border-right:30px solid transparent;
				-webkit-transform: scale(0.3,0.3);
			}
		</style>
	</head>
	<body>
		<div></div>
		<div></div>
		<div></div>
	</body>
</html>

演示结果如下:

 

3)、文字阴影

text-shadow : 水平偏移  垂直偏移  模糊  颜色  。

 

2、文字效果

一行或多行显示。


                
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值