CSS3设置圆角化

可以使用border-radius属性来设置圆角化

有四个值 分别是:左上 右上 左下 右下

三个值 分别是:左上 右上左下 右下

两个值 分别是:左上右下 右上左下

给单独一角设置圆角化可以使用:border-xxx-xxx-radius

例:左上角 圆角化: border-top-left-radius

css 复制代码
        div{
            width: 100px;
            height: 100px;
            background-color: red;
            margin: 50px 0;
            /* 设置左上角圆角 */
            border-top-left-radius: 10px;
        }

例:设置一个半圆

css 复制代码
        div{
            width: 200px;
            height: 100px;
            background-color: red;
            margin: 50px 0;
            /* 设置一个半圆 */
            border-radius: 100px 100px 0  0 ;
        }

例:设置四分之一圆

css 复制代码
          div{
            width: 100px;
            height: 100px;
            background-color: red;
            margin: 50px 0;
            /* 设置一个四分之一圆 */
            border-radius: 100px 0 0 0;
        }

原创作者:吴小糖

创作时间:2024.1.2

相关推荐
小小小小宇9 分钟前
前端看go并发
前端
前端Hardy17 分钟前
Cursor Rules 完全指南(2026 最新版)
前端·javascript·面试
程序员陆业聪18 分钟前
微前端状态管理的真相:Module Federation + 跨应用通信实战
前端
牛奶30 分钟前
浏览器是怎么把代码变成页面的?
前端·javascript·chrome
flytam32 分钟前
Claude Agent SDK 深度入门指南
前端·aigc·agent
weixin199701080161 小时前
《电天下商品详情页前端性能优化实战》
前端·性能优化
速易达网络1 小时前
vue+echarts开发的图书数字大屏系统
前端
小智社群1 小时前
贝壳获取小区的名称
开发语言·前端·javascript
Ferries1 小时前
《从前端到 Agent》系列|03:应用层-RAG(检索增强生成,Retrieval-Augmented Generation)
前端·人工智能·机器学习
Jessica_Lee1 小时前
Openclaw智能体终止机制
javascript