盒阴影和背景渐变

盒阴影:box-shadow:

水平方向偏移位置   垂直方向偏移位置 模糊度             阴影尺寸        颜色   

必选(正负值)      必选(正负)      可选(正值)    可选(正负)       可选  

位置(可选) outset(外阴影)|inset(内阴影)

例如:

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

<title></title>

<style>

.items{

width: 300px;

height: 300px;

background-color: red;

margin: 50px;

box-shadow: 10px 10px 10px 10px gold inset;

}

</style>

</head>

<body>

<div class="items">

</div>

</body>

</html>

字阴影:text-shadow:;

 水平方向阴影偏移的位置   垂直方向阴影偏移的位置  模糊度     颜色

必选正负 必选正负 可选正值   可选

例如:

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

<title></title>

<style>

.items{

width: 300px;

height: 300px;

background-color: blue;

color: #fff;

font-size: 30px;

border-radius: 50%;

line-height: 300px;

text-align: center;

text-shadow: 10px -10px 5px red;

}

</style>

</head>

<body>

<div class="items">

周五啦

</div>

</body>

</html>

背景渐变:

  1. 线性渐:background:linear-gradient(方向,颜色1,颜色2……);

方向:to left   right top bottom  deg(弧度)

  1. 径向渐变:

background:-webkit-radial-gradient(渐变中心,形状,颜色1,……)有可能不被浏览器识别

形状一般默认椭圆    circle是圆

例如:

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

<title></title>

<style>

.items{

width: 300px;

height: 300px;

border: 3px solid #000000;

/*background: linear-gradient(to right bottom,red, orange, yellow,green);*/

/*background: linear-gradient(90deg,red,orange, green,yellow);*/

background: -webkit-radial-gradient(left top,circle, red orange,green,yellow);

}

</style>

</head>

<body>

<div class="items">

</div>

</body>

</html>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值