【html】如何利用HTML+CSS制作自己的印章

大家有没有尝试过用HTML和CSS制作自己的印章.

首先印章++具有两个最基本的特点就是它是圆形的并且有边框++

当然它还有一些其他的属性吗,废话不多说我们直接上源码:

效果图:

源码:

html:

html 复制代码
<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>印章效果</title>
    <link rel="stylesheet" href="./css/styles.css" />
</head>
<body>
    <div id="con">
        <div id="box">
            内容
        </div>
    </div>
</body>
</html>

css:

css 复制代码
  #con {
            position: relative;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh; /* 为了垂直居中 */
            margin: 0;
            padding: 0;
            overflow: hidden;
        }

        #box {
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 50px; /* 调整字体大小 */
            color: #f00; /* 字体颜色 */
            font-weight: bold; /* 字体粗细 */
            font-family: 'SimSun', serif; /* 使用更传统的字体 */

            border: 3px solid #f00;
            width: 300px;
            height: 300px;
            border-radius: 50%;

            background: radial-gradient(circle at 50% 50%, #fff, #f8f8f8 50%, #f0f0f0); /* 添加背景渐变模拟纹理 */
            box-shadow: 0 0 10px 5px rgba(255, 0, 0, 0.5); /* 添加阴影和光泽效果 */

            position: relative;
        }

        #box::before {
            content: '';
            position: absolute;
            top: -10px;
            left: -10px;
            right: -10px;
            bottom: -10px;
            border: 3px dashed #f00;
            border-radius: 50%;
            opacity: 0.5;
        }

大家将HTML写好之后记得再新建一个CSS文件名字叫做 styles.css

相关推荐
Jerry Lau4 分钟前
go go go 出发咯 - go web开发入门系列(一) helloworld
开发语言·前端·golang
Mola5 分钟前
简说Vue中的nexttick原理😎
前端
李想AI6 分钟前
在Windows系统中使用Claude code的保姆级教程,附带白嫖100美金的Claude API
前端
G等你下课7 分钟前
React 事件机制原理
前端·react.js
Pedantic12 分钟前
为什么 Swift 字符串不能用 `myString[3]` 随便取字符?
前端·后端
RichardLai8814 分钟前
Kotlin Flow:构建响应式流的现代 Kotlin 之道
android·前端·kotlin
Apifox15 分钟前
提交代码后如何自动触发 Apifox 的自动化测试?
前端·后端·测试
qiyue7717 分钟前
AI编程专栏(四) - 提示词技术,如何写编程提示词
前端·ai编程
DoraBigHead20 分钟前
【JS三兄弟谁是谁】搞懂 splice、slice、split,只需一杯奶茶的时间!
前端·javascript·面试
国家不保护废物21 分钟前
前端存储与后端服务的奇妙冒险:一个Node.js服务器的诞生记(cookie实现用户登入)
前端·javascript·后端