圆角边框,盒子阴影,文字阴影

1.圆角边框

     border-radius : length

     原理:以length为半径的圆和边框的交集

     length可以是数值,百分比

     圆形:length为正方形的一半

<style>
    .big {
      width: 200px;
      height: 200px;
      background-color: yellowgreen;
      border-radius: 100px;
    }
</style>
 <div class="big"></div>

 

 圆角矩形:length为高的一半

<style>
    .big {
      width: 200px;
      height: 50px;
      background-color: yellowgreen;
      border-radius: 25px;
    }
</style>

         

        可以给不同角设置不同弧度   boder-radius: 10px 20px 30px 40px 

      (数值从左上角开始按顺时针,上,右,下,左)

2.盒子阴影

        box-shadow:   h-shadow (水平阴影位置)| v-shadow (垂直) | blur (模糊距离) |

                                spread (阴影的尺寸) | color | inset (将外部阴影改为内部)

        书写时按照上述顺序,水平和垂直位置必须写,默认是outset外阴影,可以不写

        (下面代码中 水平位置为10px 垂直为10px 模糊距离是 2px 阴影尺寸是5px,颜色为灰色)

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .big {
      width: 200px;
      height: 200px;
      background-color: yellowgreen;
      margin: 0 auto;
      box-shadow: 10px 10px 2px 5px rgba(0, 0, 0, .3);
    }
  </style>
</head>

<body>
  <div class="big"></div>
</body>

</html>

 

       盒子阴影不占用空间,不会影响其他盒子排列

3.文字阴影

       text-shadow : h-shadow | v-shadow | blur | color

       使用与盒子阴影大致相同

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    h1 {
      color: pink;
      text-shadow: 2px 2px 1px rgba(0, 0, 0, .3);
    }
  </style>
</head>

<body>
  <h1>文字阴影</h1>
</body>

</html>

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值