【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

相关推荐
子兮曰6 小时前
OpenClaw入门:从零开始搭建你的私有化AI助手
前端·架构·github
吴仰晖6 小时前
使用github copliot chat的源码学习之Chromium Compositor
前端
1024小神6 小时前
github发布pages的几种状态记录
前端
不像程序员的程序媛8 小时前
Nginx日志切分
服务器·前端·nginx
北原_春希8 小时前
如何在Vue3项目中引入并使用Echarts图表
前端·javascript·echarts
尽意啊8 小时前
echarts树图动态添加子节点
前端·javascript·echarts
吃面必吃蒜8 小时前
echarts 极坐标柱状图 如何定义柱子颜色
前端·javascript·echarts
O_oStayPositive8 小时前
Vue3使用ECharts
前端·javascript·echarts
竹秋…8 小时前
echarts自定义tooltip中的内容
前端·javascript·echarts
宝贝露.8 小时前
Axure引入Echarts图无法正常显示问题
前端·javascript·echarts