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


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

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

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

    效果图:

    源码:

    html:

    1. html>
    2. <html lang="zh">
    3. <head>
    4. <meta charset="UTF-8">
    5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
    6. <title>印章效果title>
    7. <link rel="stylesheet" href="./css/styles.css" />
    8. head>
    9. <body>
    10. <div id="con">
    11. <div id="box">
    12. 内容
    13. div>
    14. div>
    15. body>
    16. html>

    css:

    1. #con {
    2. position: relative;
    3. display: flex;
    4. justify-content: center;
    5. align-items: center;
    6. height: 100vh; /* 为了垂直居中 */
    7. margin: 0;
    8. padding: 0;
    9. overflow: hidden;
    10. }
    11. #box {
    12. display: flex;
    13. justify-content: center;
    14. align-items: center;
    15. font-size: 50px; /* 调整字体大小 */
    16. color: #f00; /* 字体颜色 */
    17. font-weight: bold; /* 字体粗细 */
    18. font-family: 'SimSun', serif; /* 使用更传统的字体 */
    19. border: 3px solid #f00;
    20. width: 300px;
    21. height: 300px;
    22. border-radius: 50%;
    23. background: radial-gradient(circle at 50% 50%, #fff, #f8f8f8 50%, #f0f0f0); /* 添加背景渐变模拟纹理 */
    24. box-shadow: 0 0 10px 5px rgba(255, 0, 0, 0.5); /* 添加阴影和光泽效果 */
    25. position: relative;
    26. }
    27. #box::before {
    28. content: '';
    29. position: absolute;
    30. top: -10px;
    31. left: -10px;
    32. right: -10px;
    33. bottom: -10px;
    34. border: 3px dashed #f00;
    35. border-radius: 50%;
    36. opacity: 0.5;
    37. }

     

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

  • 相关阅读:
    Android 沉浸式状态栏
    基于智能优化算法实现的机械臂避障路径规划(Matlab代码实现)
    Redis—跳跃表
    NewCoder 排队
    博客系统项目详解
    基于SpringBoot的CSGO赛事管理系统
    HTML常用标签
    java反射所需要了解的基本知识点
    神经网络中的核心概念是,神经网络的主要内容
    SQL 的 AND、OR 和 NOT 运算符:条件筛选的高级用法
  • 原文地址:https://blog.csdn.net/weixin_56334307/article/details/139584192