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

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

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

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

效果图:

源码:

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:

  #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. 【教你如何制作一个简单HTML个人网页】

    2024-06-11 09:38:01       42 阅读
  2. 【教你如何制作一个简单HTML个人网页】

    2024-06-11 09:38:01       48 阅读
  3. Qt Designer 如何添加自己制作控件?

    2024-06-11 09:38:01       30 阅读
  4. 如何利用python实现自己modbus-tcp库

    2024-06-11 09:38:01       45 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-06-11 09:38:01       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-06-11 09:38:01       100 阅读
  3. 在Django里面运行非项目文件

    2024-06-11 09:38:01       82 阅读
  4. Python语言-面向对象

    2024-06-11 09:38:01       91 阅读

热门阅读

  1. 如何用visual studio 2022创建MAUI的Hello world程序

    2024-06-11 09:38:01       24 阅读
  2. 使用docker部署在MacOS上部署minecraft服务器

    2024-06-11 09:38:01       28 阅读
  3. VB.net调用VC DLL

    2024-06-11 09:38:01       26 阅读
  4. 程序员如何高效挖掘市场需求

    2024-06-11 09:38:01       25 阅读
  5. MyEclipse 新手使用教程

    2024-06-11 09:38:01       37 阅读
  6. adb 脚本化Android系统截图和录屏

    2024-06-11 09:38:01       33 阅读
  7. 记一次大量CSV数据文件同步到数据库

    2024-06-11 09:38:01       29 阅读
  8. go_compiler

    2024-06-11 09:38:01       28 阅读
  9. 平均召回(Average Recall,AR)概述

    2024-06-11 09:38:01       47 阅读
  10. 细说wayland和X11

    2024-06-11 09:38:01       31 阅读