CSS3新增边框属性(五)

1、新增边框属性

1.1 border-radius

设置盒子的圆角。

html 复制代码
<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <title>border-radios</title>
    <style>
        div {
            height: 400px;
            width: 400px;
            border: 1px solid black;
            /* 同时设置四个方向的圆角 */
            /* border-radius: 10px; */
            border-radius: 50%;
            /* 设置左上圆角 */
            /* border-top-left-radius: 10px; */
            /* 设置右上圆角 */
            /* border-top-right-radius: 20px; */
            /* 设置右下圆角 */
            /* border-bottom-right-radius: 20px; */
            /* 设置左下圆角 */
            /* border-bottom-left-radius: 10px; */
        }
    </style>
</head>

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

</html>
1.2 outline
  • outline-width:外轮廓宽度;
  • outline-color:外轮廓颜色;
  • outline-style:外轮廓风格;
    • none:无轮廓;
    • dotted:点状轮廓;
    • dashed:虚线轮廓;
    • solid:实线轮廓;
    • double:双线轮廓。
  • outline:宽度 样式 颜色

可以使用outline-offset属性设置外边框与盒子的距离。

html 复制代码
<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <title>outline</title>
    <style>
        div {
            height: 400px;
            width: 400px;
            border: 10px solid black;
            padding: 10px;
            background-color: aqua;
            margin: 0 auto;
            margin-top: 50px;

            outline: 10px dashed rgb(0, 42, 255);
            outline-offset: 20px;
        }
    </style>
</head>

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

</html>
相关推荐
xiaofeichaichai9 小时前
Webpack
前端·webpack·node.js
问心无愧051310 小时前
ctf show web入门111
android·前端·笔记
唐某人丶10 小时前
模型越来越强,我们还需要 Agent 工程吗?—— 从价值重估到 Harness 实践
前端·agent·ai编程
智码看视界10 小时前
现代Web开发基础:全栈工程师的起航点
前端·后端·c5全栈
JS菌10 小时前
手写一个 AI Agent 全栈项目:从沙箱执行到子智能体的完整实现
前端·人工智能·后端
excel11 小时前
HLS TS 文件损坏的元凶:Git 提交与拉取
前端
Aphasia31112 小时前
https连接传输流程
前端·面试
徐小夕12 小时前
万字长文!千万级文档 RAG 知识库系统落地实践
前端·算法·github
threelab12 小时前
Three.js 物理模拟着色器 | 三维可视化 / AI 提示词
开发语言·前端·javascript·人工智能·3d·着色器