Logo
首页
前沿
AI热点新闻
36氦头条
博客
开源
极简简历
极简智库
瞬间
相册
友链
知识库
创作者
搜索文章 Ctrl K

千古前端图文教程

返回 0
  • 导读
  • 前端工具
    • 从终端启动VS-Code,并设置vscode启动的命令别名
    • 设置当前仓库的用户名为空
    • 网络抓包和代理工具-Whistle
    • 将本地的-test、Test-目录都删掉,并生成一个新的目录-Temp
    • Atom在前端的使用
    • Emmet-in-VS-Code
    • GitHub的使用
    • Mac安装和配置iTerm2
    • Sublime-Text在前端中的使用
    • 安装
    • WebStorm的使用
    • chrome浏览器
    • iconMoon
  • HTML
    • 认识Web和Web标准
    • 浏览器的介绍
    • 初识HTML
    • HTML标签-排版标签
    • HTML标签-字体标签和超链接
    • HTML标签-图片标签
    • html标签图文详解(二)
    • HTML5详解
    • HTML5举例-简单的视频播放器
    • HTML5详解(二)
    • 注释以开头
    • HTML基础回顾
  • CSS基础
    • CSS属性-字体属性和文本属性
    • CSS属性-背景属性
    • CSS样式表和选择器
    • CSS选择器-伪类
    • CSS样式表的继承性和层叠性
    • CSS盒模型详解
    • 浮动
    • CSS属性-定位属性
    • CSS案例讲解-博雅互动
    • CSS3选择器详解
    • CSS3属性详解(一)
    • CSS3属性详解-动画详解
    • CSS3属性-Flex布局图文详解
    • CSS3属性详解-Web字体
    • Sass入门
    • 浏览器的兼容性问题
    • CSS3的常见边框汇总
    • others
  • CSS进阶
    • 准备
    • CSS中的非布局样式
    • CSS布局
    • 网页设计和开发中,关于字体的常识
    • 如何让一个元素水平垂直居中
    • CSS开发积累
    • CSS文章推荐
    • CSS的一些小知识
    • CSS面试题
  • JavaScript基础
    • 编程语言和JavaScript简介
    • 开始写JavaScript-hello-world
    • 常量和变量
    • 以下关键字只在严格模式中被当成保留字,在ES6中是属于关键字
    • 变量的数据类型-基本数据类型和引用数据类型
    • 基本数据类型-String-和-Boolean
    • 基本数据类型-Number
    • 基本数据类型-Undefined-和-Null
    • 数据类型转换
    • 运算符
    • 流程控制语句-选择结构(if和switch)
    • 流程控制语句-循环结构(for和while)
    • 对象简介
    • 基本包装类型
    • 内置对象-String-字符串的常见方法
    • 内置对象-Number和Math
    • 内置对象-Date
    • 数组简介
    • 数组的常见方法
    • 函数简介
    • 递归函数
    • 立即执行函数
    • 作用域、变量提升、函数提升
    • 预编译
    • this指向
    • 闭包
    • 面向对象简介
    • 对象的创建&构造函数
    • 对象的基本操作
    • 浅拷贝和深拷贝
    • 对象的高级操作
    • 原型链和原型继承(待更新)
    • 类和构造继承(待更新)
    • 正则表达式
    • 事件简介
    • DOM简介和DOM操作
    • 通过style对象获取和设置行内样式
    • offset相关属性和匀速动画(含轮播图的实现)
    • scroll相关属性和缓动动画
    • client(可视区)相关属性
    • 事件的绑定和事件对象Event
    • 事件的传播和事件冒泡
    • 事件委托
    • 键盘事件
    • BOM简介和navigator.userAgent&History&Location
    • 定时器
    • jQuery的介绍和选择器
    • jQuery动画详解
    • jQuery操作DOM
    • jQuery的事件机制和其他知识
    • Zepto入门
    • BOM的常见内置方法和内置对象
    • 原型对象
    • 原型链
    • 常见代码解读
  • JavaScript基础-ES6语法
    • ES5和ES6的介绍
    • ES5中的严格模式
    • ES5中的一些扩展
    • ES6-变量-let、const-和块级作用域
    • ES6-变量的解构赋值
    • ES6-箭头函数
    • 剩余参数和扩展运算符
    • 字符串、数组、对象的扩展
    • 内置对象扩展-Set数据结构
    • ES6-Symbol
  • JavaScript基础-异步编程
    • 服务器分类及PHP入门
    • 单线程和异步任务
    • Ajax入门和发送http请求
    • Ajax传输json和XML
    • 同源和跨域
    • 回调函数
    • Promise入门详解
    • Promise实例的方法
    • Promise的链式调用
    • Promise类的方法
    • async异步函数
    • 异常处理方案
    • 事件循环机制、宏任务和微任务
    • Promise的高级用法
    • Promise常见面试题
  • JavaScript进阶
    • var、let、const的区别
    • 浅拷贝和深拷贝
    • 迭代器和生成器
    • JavaScript开发积累
    • Promise的一些题目
    • call、apply、bind的区别
    • this
    • 作用域
    • 创建对象和继承
    • 数据的赋值
    • 数组的进阶操作
    • 高阶函数
  • 前端基本功-CSS和DOM练习
    • CSS基础练习-JD首页的制作(顶部和底部)
    • CSS基础练习-JD首页的制作(快捷导航部分)
    • DOM操作练习-基础练习
    • DOM操作练习-Tab栏切换(通过className设置样式)
    • DOM操作练习-访问关系的封装
    • DOM操作练习-innerHTML的方式创建元素
  • 移动Web开发
    • Bootstrap入门
    • Bootstrap使用
    • Less详解
  • MySQL数据库
    • 数据库的基础知识
    • mysql
    • 语法格式
    • 新建一张表
    • 举例
    • MySQL设计三大范式
    • 事务
  • Node.js
    • Node.js介绍
    • Node.js的特点
    • 安装举例
    • 运行main.js启动程序。此时,main.js就是主模块
    • Node.js内置模块-fs文件模块
    • Node.js内置模块-path路径模块
    • 注意,这里的-root-请填你的user账号,-localhost-请填-你的-host
    • CommonJS
    • ES6
    • JavaScript模块化-AMD
    • JavaScript模块化-CMD
    • JavaScript模块化-ES6
    • KOA2
    • Node.js代码举例
    • WebSocket
    • 事件驱动和非阻塞机制
  • Vue基础
    • 最新稳定版
    • Vue的系统指令
    • v-on的事件修饰符
    • Vue的系统指令二
    • Vue的举例-列表功能
    • 自定义过滤器-时间格式化举例
    • 自定义按键修饰符&自定义指令
    • Vue实例的生命周期函数
    • Vue中的Ajax请求
    • Vue动画
    • Vue组件的定义和注册
    • Vue组件之间的传值
    • Vue-router路由
    • Vue-router路由
    • Vue.js在开发中的常见写法积累
    • Vue开发积累
    • Vue组件
  • React基础
    • React介绍
    • JSX语法介绍
    • React组件(一)-生命周期
    • React组件(二)-常见属性和函数
    • React中绑定this并给函数传参的几种方式
    • React的单向数据绑定
    • React路由的使用
    • Ant-Design的基本使用
    • AntD框架的upload组件上传图片时遇到的一些坑
    • AntD框架的upload组件上传图片时使用customRequest方法自定义上传行为
    • React-Navive初识
  • 前端性能优化
    • 前端性能优化认知
    • 安装
    • 浏览器渲染机制
    • 渲染优化
    • 压缩命令。注意,这里是将压缩级别设置为3。如果将压缩级别设置为1或者2,则基本不压缩。
    • 页面渲染性能优化
    • lazyload&防抖动和节流阀
  • 前端工程化
    • 前端代码规范
    • 前端书籍推荐
    • Vue开发积累
    • 前端工程化
    • 前端常见专有名词
    • 前端的几道题目
    • 前端监控技术
    • 数组的常见操作
  • 前端综合
    • Web前端开发流程和学习路线(详尽版)
    • Web前端入门自学路线(精简版)
    • 年-前端日记
    • 年-前端日记
    • 年-前端日记
    • 年-前端日记
    • 年-前端日记
    • CSS开发总结
    • Express
    • ajax相关
    • html相关
    • json字符串的解析和遍历
    • json相关
    • 上海有哪些IT互联网大厂
    • 前端分享群整理
    • 前端博客推荐
    • 前端开发积累
    • 前端语录
    • 北京有哪些IT互联网大厂
    • 模板引擎
    • 深圳有哪些IT互联网大厂
    • 网友对本项目提的建议
  • 资源推荐
    • 前端书籍推荐
    • Web前端最新导航
    • 前端学习资源推荐
    • 前端大佬名单
    • 前端GitHub项目整理
    • 前端文章推荐
    • 推荐文章
    • 推荐文章

CSS3的常见边框汇总

CSS3 常见边框汇总

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>CSS3 边框</title>
    <style>
        body, ul, li, dl, dt, dd, h1, h2, h3, h4, h5 {
            margin: 0;
            padding: 0;
        }

        body {
            background-color: #F7F7F7;
        }

        .wrapper {
            width: 1000px;
            margin: 0 auto;
            padding: 20px;
            box-sizing: border-box;
        }

        header {
            padding: 20px 0;
            margin-bottom: 20px;
            text-align: center;
        }

        header h3 {
            line-height: 1;
            font-weight: normal;
            font-size: 28px;
        }

        .main {
            /*overflow: hidden;*/
        }

        .main:after {
            content: '';
            clear: both;
            display: block;
        }

        .main .item {
            width: 210px;
            height: 210px;
            margin: 0 30px 30px 0;
            display: flex;
            position: relative;
            background-color: #FFF;
            float: left;
            box-shadow: 2px 2px 5px #CCC;
        }

        .main .item:after {
            content: attr(data-brief);
            display: block;
            width: 100%;
            height: 100%;
            text-align: center;
            line-height: 210px;
            position: absolute;
            top: 0;
            left: 0;
            color: #FFF;
            font-family: '微软雅黑';
            font-size: 18px;
            background-color: rgba(170, 170, 170, 0);
            z-index: -1;
            transition: all 0.3s ease-in;
        }

        .main .item:hover:after {
            background-color: rgba(170, 170, 170, 0.6);
            z-index: 100;
        }

        .main .item:nth-child(4n) {
            margin-right: 0;
        }

        /*.main .item:nth-last-child(-n+5) {
            margin-bottom: 0;
        }*/

        /* 以上是骨架样式 */
        /* 1、2、3、4 顺时针 */
        .border-radius {
            width: 180px;
            height: 180px;
            margin: auto;
            border: 1px solid red;
            /*border-radius: 50% 30% 20%;*/
        }

        .square {
            border-radius: 0;
        }

        /*拱形*/
        .item:nth-child(1) .border-radius {
            border-radius: 90px;
        }

        /*拱形*/
        .item:nth-child(2) .border-radius {
            border-radius: 90px 90px 0 0;
        }

        /*半圆*/
        .item:nth-child(3) .border-radius {
            height: 90px;
            border-radius: 90px 90px 0 0;
        }

        /*左上角*/
        .item:nth-child(4) .border-radius {
            /*height: 90px;*/
            border-radius: 90px 0 0 0;
        }

        /*四分之一圆*/
        .item:nth-child(5) .border-radius {
            width: 90px;
            height: 90px;
            border-radius: 90px 0 0 0;
        }

        /*横着的椭圆*/
        .item:nth-child(6) .border-radius {
            height: 90px;
            /*border-radius: 50%;*/
            border-radius: 90px 90px 90px 90px / 45px 45px 45px 45px;
            /*border-radius: 45px / 90px;*/
        }

        /*竖着的椭圆*/
        .item:nth-child(7) .border-radius {
            width: 90px;
            border-radius: 45px 45px 45px 45px / 90px 90px 90px 90px;
        }

        /*半个横着的椭圆*/
        .item:nth-child(8) .border-radius {
            height: 45px;
            border-radius: 90px 90px 0 0 / 45px 45px 0 0;
        }

        /*半个竖着的椭圆*/
        .item:nth-child(9) .border-radius {
            width: 45px;
            border-radius: 45px 0 0 45px / 90px 0 0 90px;
        }

        /*四分之一竖着的椭圆*/
        .item:nth-child(10) .border-radius {
            width: 45px;
            height: 90px;
            border-radius: 45px 0 0 0 / 90px 0 0 0;
        }

        /*饼环*/
        .item:nth-child(11) .border-radius {
            width: 40px;
            height: 40px;
            border: 70px solid red;
            border-radius: 90px;
        }

        /*圆饼*/
        .item:nth-child(12) .border-radius {
            width: 40px;
            height: 40px;
            border: 70px solid red;
            border-radius: 60px;
        }

        /*左上角圆饼*/
        .item:nth-child(13) .border-radius {
            width: 60px;
            height: 60px;
            border: 60px solid red;
            border-radius: 90px 0 0 0;
        }

        /*对角圆饼*/
        .item:nth-child(14) .border-radius {
            width: 60px;
            height: 60px;
            border: 60px solid red;
            border-radius: 90px 0 90px 0;
        }

        /*四边不同色*/
        .item:nth-child(15) .border-radius {
            width: 0px;
            height: 0px;
            border-width: 90px;
            border-style: solid;
            border-color: red green yellow blue;
        }

        /*右透明色*/
        .item:nth-child(16) .border-radius {
            width: 0px;
            height: 0px;
            border-width: 90px;
            border-style: solid;
            border-color: red green yellow blue;
            border-right-color: transparent;
        }

        /*圆右透明色*/
        .item:nth-child(17) .border-radius {
            width: 0px;
            height: 0px;
            border-width: 90px;
            border-style: solid;
            border-color: red;
            border-right-color: transparent;
            border-radius: 90px;
        }

        /*圆右红透明色*/
        .item:nth-child(18) .border-radius {
            width: 0px;
            height: 0px;
            border-width: 90px;
            border-style: solid;
            border-color: transparent;
            border-right-color: red;
            border-radius: 90px;
        }

        /*阴阳图前世*/
        .item:nth-child(19) .border-radius {
            width: 180px;
            height: 0px;
            border-top-width: 90px;
            border-bottom-width: 90px;
            border-style: solid;
            border-top-color: red;
            border-bottom-color: green;
            /*border-right-color: red;*/
            border-radius: 90px;
        }

        /*阴阳图前世2*/
        .item:nth-child(20) .border-radius {
            width: 180px;
            height: 90px;
            border-bottom-width: 90px;
            border-style: solid;
            border-bottom-color: green;
            background-color: red;
            /*border-right-color: red;*/
            border-radius: 90px;
        }

        /*阴阳图今生*/
        .item:nth-child(21) .border-radius {
            width: 180px;
            height: 90px;
            border-bottom-width: 90px;
            border-style: solid;
            border-bottom-color: green;
            background-color: red;
            border-radius: 90px;
            position: relative;
        }

        .item:nth-child(21) .border-radius::after,
        .item:nth-child(21) .border-radius::before {
            content: '';
            position: absolute;
            top: 50%;
            width: 20px;
            height: 20px;
            /*margin: -10px 0 0 0;*/
            border-width: 35px;
            border-style: solid;
            border-radius: 45px;
        }

        /*左阴阳*/
        .item:nth-child(21) .border-radius::after {
            background-color: red;
            border-color: green;
        }

        /*右阴阳*/
        .item:nth-child(21) .border-radius::before {
            background-color: green;
            border-color: red;
            right: 0;
        }

        /*右阴阳*/
        .item:nth-child(22) .border-radius {
            width: 180px;
            height: 90px;
            border-bottom-width: 90px;
            border-bottom-color: green;
            border-bottom-style: solid;
            background-color: red;
            border-radius: 90px;
            position: relative;
        }

        .item:nth-child(22) .border-radius::after,
        .item:nth-child(22) .border-radius::before {
            content: '';
            position: absolute;
            top: 50%;
            width: 20px;
            height: 20px;
            border-width: 35px;
            border-style: solid;
            border-radius: 45px;
        }

        .item:nth-child(22) .border-radius::before {
            border-color: green;
            background-color: red;
        }

        .item:nth-child(22) .border-radius::after {
            right: 0;
            border-color: red;
            background-color: green;
        }

        /*消息框*/
        .item:nth-child(23) .border-radius {
            width: 160px;
            height: 80px;
            background-color: red;
            border-radius: 6px;
            position: relative;
        }

        .item:nth-child(23) .border-radius::after {
            content: '';
            width: 0;
            height: 0;
            border-width: 10px;
            border-style: solid;
            border-color: transparent;
            border-right-color: red;
            position: absolute;
            top: 16px;
            left: -20px;
        }

        /*奇怪的图形*/
        .item:nth-child(24) .border-radius {
            width: 40px;
            height: 40px;
            border-width: 45px 0 45px 70px;
            border-style: solid;
            border-radius: 0 0 60px 0;
            border-color: red;
        }

        /*奇怪的图形2*/
        .item:nth-child(25) .border-radius {
            width: 100px;
            height: 40px;
            border-width: 45px 20px 45px 70px;
            border-style: solid;
            border-radius: 60px;
            border-color: red;
        }

        /*QQ对话*/
        .item:nth-child(26) .border-radius {
            width: 160px;
            height: 80px;
            background-color: red;
            border-radius: 6px;
            position: relative;
        }

        .item:nth-child(26) .border-radius::after {
            content: '';
            position: absolute;
            top: 0;
            right: -20px;
            width: 30px;
            height: 30px;
            border-width: 0 0 30px 30px;
            border-style: solid;
            border-bottom-color: red;
            border-left-color: transparent;
            border-radius: 0 0 60px 0;
        }

        /*圆角的百分比设置 */
        .item:nth-child(27) .border-radius {
            width: 180px;
            /*height: 180px;*/
            height: 90px;
            border-radius: 50%;
            border-radius: 90px/45px;

            /*百分比是按横竖两个对应的方向的长度进行计算*/
        }

    </style>
</head>
<body>
<div class="wrapper">
    <header>
        <h3>CSS3 边框圆角</h3>
    </header>
    <div class="main">
        <div class="item" data-brief="整圆">
            <div class="border-radius"></div>
        </div>
        <div class="item" data-brief="拱形">
            <div class="border-radius"></div>
        </div>
        <div class="item" data-brief="半圆">
            <div class="border-radius"></div>
        </div>
        <div class="item" data-brief="左上角">
            <div class="border-radius"></div>
        </div>
        <div class="item" data-brief="四分之一圆">
            <div class="border-radius"></div>
        </div>
        <div class="item" data-brief="横着的椭圆">
            <div class="border-radius"></div>
        </div>
        <div class="item" data-brief="竖着的椭圆">
            <div class="border-radius"></div>
        </div>
        <div class="item" data-brief="半个横着的椭圆">
            <div class="border-radius"></div>
        </div>
        <div class="item" data-brief="半个竖着的椭圆">
            <div class="border-radius"></div>
        </div>
        <div class="item" data-brief="四分之一竖着的椭圆">
            <div class="border-radius"></div>
        </div>
        <div class="item" data-brief="饼环">
            <div class="border-radius"></div>
        </div>
        <div class="item" data-brief="圆饼">
            <div class="border-radius"></div>
        </div>
        <div class="item" data-brief="左上角圆饼">
            <div class="border-radius"></div>
        </div>
        <div class="item" data-brief="对角圆饼">
            <div class="border-radius"></div>
        </div>
        <div class="item" data-brief="四边不同色">
            <div class="border-radius"></div>
        </div>
        <div class="item" data-brief="右透明色">
            <div class="border-radius"></div>
        </div>
        <div class="item" data-brief="圆右透明色">
            <div class="border-radius"></div>
        </div>
        <div class="item" data-brief="圆右红透明色">
            <div class="border-radius"></div>
        </div>
        <div class="item" data-brief="阴阳图前世">
            <div class="border-radius"></div>
        </div>
        <div class="item" data-brief="阴阳图前世2">
            <div class="border-radius"></div>
        </div>
        <div class="item" data-brief="阴阳图今生">
            <div class="border-radius"></div>
        </div>
        <div class="item" data-brief="阴阳图今生2">
            <div class="border-radius"></div>
        </div>
        <div class="item" data-brief="消息框">
            <div class="border-radius"></div>
        </div>
        <div class="item" data-brief="奇怪的图形">
            <div class="border-radius"></div>
        </div>
        <div class="item" data-brief="奇怪的图形2">
            <div class="border-radius"></div>
        </div>
        <div class="item" data-brief="QQ对话">
            <div class="border-radius"></div>
        </div>
        <div class="item" data-brief="圆角百分比">
            <div class="border-radius"></div>
        </div>
    </div>
</div>
</body>
</html>

效果如下:

爱心

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <style>
        .heart {
            width: 200px;
            height: 300px;
            /*border: 1px solid #000;*/
            margin: 100px auto;
            position: relative;
        }

        .heart::before, .heart::after {
            content: "左一半";
            width: 100%;
            height: 100%;
            position: absolute;
            background-color: red;
            left: 0;
            top: 0;

            border-radius: 100px 100px 0 0;
            transform: rotate(-45deg);
            text-align: center;
            line-height: 100px;
            color: yellow;
            font-size: 30px;
            font-family: "MIcrosoft Yahei";
        }

        .heart::after {
            content: "右一半";
            left: 71px;
            transform: rotate(45deg);
        }
    </style>
</head>
<body>
<div class="heart">

</div>
</body>
</html>

效果如下:

它其实是下面这两个盒子叠起来的:

改变 .heart::after 的 left值,即可叠起来。

目录
    共 268 篇 千古前端图文教程 / CSS3的常见边框汇总 0 字 0 行 cosolar
    创建 2026-11-08T09:55:03.480251883Z 更新 2026-11-08T09:57:49.232799108Z
    Logo

    以极简为笔,以求索为墨。 简单书写,深度思考,每一次记录,都是与内心的对话。

    30,295 访问量
    219 点赞数
    0 评论数
    162 文章数 13 分类数 243 标签数
    2026-06-06 建站时间
    中国·北京 博主地址

    订阅更新

    订阅我们的技术文章,每周精选内容送达你的邮箱

    隐私政策 | 使用条款 | 友情链接 | 关于我们
    本主题由 腾讯云 提供云服务
    © 极简笔记 版权所有 津ICP备2026156702号-1
    Powered by Halo Theme halo-theme-cosolar