CSS学习(七)——圆角边框,盒子阴影

圆角边框

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <!--
    border-radius:;
    若后面是两个数值,代表:左上,右下;左下,右上
    若后面是四个数值,代表:左上,右上,左下,右下
    -->
    <!--
    当border-radius后只有一个值
    圆圈:圆角=半径(半径要与长宽相等,否则只不过是变成了一个圆角四边形)
     -->
    <style>

        .t1{
            width: 100px;
            height: 100px;
            border: 10px dashed blue;
            border-radius: 0 0 0 50px;
        }
        .t2{
            width: 100px;
            height: 100px;
            border: 10px dashed blue;
            border-radius: 0 0 200px 200px;
        }
        #d1 div{
            width: 100px;
            height: 50px;
            margin: 30px;
            background-color: #e70e27;
            border-radius: 50px 50px 0 0;
        }
        #d1 img{
            border-radius: 50px;
        }
    </style>
</head>
<body>
<div></div>
<div class="t1"></div>
<div class="t2"></div>
<div id="d1">
    <div></div>
    <img src="../../lession02/6.背景/images/abc.jpg" alt="">
</div>

</body>
</html>

盒子阴影

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        div{
            width: 100px;
            height: 100px;
            border: 10px solid blue;
            box-shadow: #41d7b9 10px 10px 1px;
        }
        /*margin 0 auto;居中
        要求:块元素,块元素有宽度*/
        img{
            margin: 0 auto;
            height: 500px;
            border-radius: 500px 500px 500px 500px ;
            box-shadow: yellow 10px 10px 100px;
        }
    </style>
</head>
<body>
<div></div>
<div style="height: 800px;width: 600px;margin: 0 auto;text-align: center">
    <img src="../../lession02/6.背景/images/abc.jpg" alt="">
</div>
</body>
</html>
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值