CSS笔记(黑马程序员pink老师前端)圆角边框

圆角边框

border-radius:length;

效果显示

html 复制代码
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<style>
    * {
        margin: 0;
        padding: 0;
    }

    div {
        display: inline-block;
        margin-top: 20px;
        margin-left: 30px;
        background-color: pink;
    }

    .div1 {
        /* 圆角边框,用半径为10px的圆,切原有的矩形 */
        border-radius: 10px;
        height: 100px;
        width: 200px;
    }

    .div2 {
        /* border-radius的值也可为百分比,当切角圆的
        半径为正方形的一半时,显示为圆形 */
        border-radius: 50%;
        height: 100px;
        width: 100px;
    }

    .div3 {
        /*圆的半径为高度的一半 */
        border-radius: 60px;
        height: 100px;
        width: 200px;
    }

    .div4 {
        /*依次设置不同的角 */
        border-radius: 10px 20px 40px 80px;
        height: 100px;
        width: 200px;
    }

    .div5 {
        /*只有两个值,为对角线关系 */
        border-radius: 40px 10px;
        height: 100px;
        width: 200px;
    }

    .div6 {
        /*单独设一个角,top与left的顺序不能变 */
        border-top-left-radius: 20px;
        height: 100px;
        width: 200px;
    }
</style>

<body>


    <div class="div1"></div>
    <div class="div2"></div>
    <div class="div3"></div>
    <div class="div4"></div>
    <div class="div5"></div>
    <div class="div6"></div>
</body>

</html>
相关推荐
weixin_4277716139 分钟前
cursor 智能commit
前端
努力的小陈^O^43 分钟前
问题:Spring循环依赖问题排查与解决
java·开发语言·前端
徐_三岁1 小时前
127.0.0.1 和 localhost 有什么区别?
前端
沛沛老爹2 小时前
Web开发者转型AI:Agent Skills版本控制与管理实战——从Git到AI技能仓库
java·前端·人工智能·git·架构·rag
yyt3630458412 小时前
TypeScript { [key: string]: unknown } 索引签名写法和 Record 替代
前端·javascript·vue.js·typescript·ecmascript·es6
揽昕2 小时前
判断对象是否含有某个属性
开发语言·前端·javascript
要做朋鱼燕3 小时前
【AES加密专题】3.工具函数的编写(1)
笔记·密码学·嵌入式·aes
前端小趴菜053 小时前
TypeScript
前端·typescript
嵌入式知行合一3 小时前
时间管理方法论
笔记
儒雅的晴天3 小时前
git笔记
笔记·git