【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

相关推荐
小小小小宇1 小时前
前端并发控制管理
前端
小小小小宇2 小时前
前端SSE笔记
前端
小小小小宇2 小时前
前端 WebSocket 笔记
前端
小小小小宇3 小时前
前端visibilitychange事件
前端
小小小小宇3 小时前
前端Loader笔记
前端
烛阴4 小时前
从0到1掌握盒子模型:精准控制网页布局的秘诀
前端·javascript·css
前端工作日常8 小时前
我理解的`npm pack` 和 `npm install <local-path>`
前端
李剑一8 小时前
说个多年老前端都不知道的标签正确玩法——q标签
前端
嘉小华8 小时前
大白话讲解 Android屏幕适配相关概念(dp、px 和 dpi)
前端
姑苏洛言8 小时前
在开发跑腿小程序集成地图时,遇到的坑,MapContext.includePoints(Object object)接口无效在组件中使用无效?
前端