代码 html夫妻约定

2024-11-19 01:24:21 +0800 CST views 777
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>约定书</title>
    <style>
         html{
             font-size: 20px;
         }
    
        body {
            font-family: "Microsoft YaHei", sans-serif;
            padding: 2rem;
            margin: 0;
            box-sizing: border-box;
            width: 30rem;
            text-align: center;
            margin: 0 auto;
        }
        h1 {
            color: red;
            text-align: center;
            font-size: 2rem;
        }
        .subtitle {
            text-align: center;
            font-size: 1.2rem;
        }
        p {
            text-indent: 2em;
            font-size: 1rem;
            line-height: 1.8;
            text-align: justify;
            margin: 20px 0;
        }
        .highlight {
            color: red;
            font-weight: bold;
            text-align: center;
        }
        .signature {
            text-align: right;
            margin-top: 40px;
        }
        .signature div {
            display: inline-block;
            margin: 0 30px;
        }
        .editable {
            cursor: pointer;
            outline: none;
            /*border-bottom: 1px dashed #ccc;*/
            display: inline-block;
        }
        .date {
            text-align: right;
            margin-top: 20px;
            float: right;
        }
        hr{
            border: none;
            border-top: 2px solid red;
            margin: 20px 0;
        }
        .flex{
                display: flex !important;
                align-items: center;
                justify-content: center;
        }
        .sy{
                position: relative;
        }
        .sy .sy1{
                width: 3rem;
                transform: rotate(15deg);
        }
        .sy-text{
            position: absolute;
            top:50%;
            left: 50%;
        }
        @font-face {
    font-family: 'MyCustomFont'; /* 定义字体的名称 */
    src: 
         url('段宁毛笔精美行书.ttf') format('truetype'); /* 引用 .ttf 文件 */
    font-weight: normal; /* 字体粗细 */
    font-style: normal; /* 字体样式 */
}
        .sybg,.sybg2{
                background-image: url(sy1.png);
                background-size: 3rem auto;
                background-repeat: no-repeat;
                /* width: 300px; */
                height: 100px;
                display: flex;
                justify-content: center;
                align-items: center;
                background-position: center;
                font-family: 'MyCustomFont';
                    font-size: 2rem;
        min-width: 100px;
        }
        .sybg2{
            background-image: url(sy2.png);
        }
        .data-text{
            font-family: 'MyCustomFont';
            font-weight:bold;
        }
    </style>
</head>
<body>
    <h1 contenteditable="true" class="editable">约定书</h1>
    <div class="subtitle editable" contenteditable="true"  style="display:block">约字[2024] 001号</div>
    <hr>
    <p contenteditable="true" class="editable">
        我们可以吵架,但不能记仇,更不能分开,这是约定。因为夫妻就是一双筷子,有苦一起吃,有甜一起享,有难一起扛,有累一起忙。
    </p>
    <p contenteditable="true" class="editable">
        融入了同一个家庭,不说感谢,不分彼此,最好的感情不是一辈子不吵架,而是吵了还能一辈子,闹了一辈子,还想风雨同舟,携手此生!
    </p>
    <p class="highlight" contenteditable="true" class="editable">
        特此约定,遇你、与你、予你、余你!
    </p>

    <div class="signature flex" style="justify-content: flex-end;">
        <div contenteditable="true" class="editable flex" >
            老公:
            <span class="sybg">
                茄子
            </span>
        </div>
        <div contenteditable="true" class="editable flex">
            老婆:
            <span class="sybg2">
                茄子
            </span>
        </div>
    </div>

    <div class="date editable" contenteditable="true" >
        签发日期:<span class="data-text">2024.10.23</span>
    </div>

    <script>
        document.querySelectorAll('.editable').forEach(function(element) {
            element.addEventListener('click', function() {
                this.focus();
            });
        });
    </script>
</body>
</html>

images

复制全文 生成海报 HTML 情感 家庭 约定

推荐文章

Vue3 vue-office 插件实现 Word 预览
2024-11-19 02:19:34 +0800 CST
Python 获取网络时间和本地时间
2024-11-18 21:53:35 +0800 CST
Vue3中如何处理SEO优化?
2024-11-17 08:01:47 +0800 CST
liunx服务器监控workerman进程守护
2024-11-18 13:28:44 +0800 CST
动态渐变背景
2024-11-19 01:49:50 +0800 CST
Vue3 结合 Driver.js 实现新手指引
2024-11-18 19:30:14 +0800 CST
乐观锁和悲观锁,如何区分?
2024-11-19 09:36:53 +0800 CST
PHP 微信红包算法
2024-11-17 22:45:34 +0800 CST
全新 Nginx 在线管理平台
2024-11-19 04:18:33 +0800 CST
纯CSS实现3D云动画效果
2024-11-18 18:48:05 +0800 CST
在 Vue 3 中如何创建和使用插件?
2024-11-18 13:42:12 +0800 CST
前端代码规范 - Commit 提交规范
2024-11-18 10:18:08 +0800 CST
Vue3中如何使用计算属性?
2024-11-18 10:18:12 +0800 CST
OpenCV 检测与跟踪移动物体
2024-11-18 15:27:01 +0800 CST
如何配置获取微信支付参数
2024-11-19 08:10:41 +0800 CST
html文本加载动画
2024-11-19 06:24:21 +0800 CST
Rust 与 sqlx:数据库迁移实战指南
2024-11-19 02:38:49 +0800 CST
20个超实用的CSS动画库
2024-11-18 07:23:12 +0800 CST
平面设计常用尺寸
2024-11-19 02:20:22 +0800 CST
PHP 允许跨域的终极解决办法
2024-11-19 08:12:52 +0800 CST
如何优化网页的 SEO 架构
2024-11-18 14:32:08 +0800 CST
一些高质量的Mac软件资源网站
2024-11-19 08:16:01 +0800 CST
mysql 计算附近的人
2024-11-18 13:51:11 +0800 CST
介绍25个常用的正则表达式
2024-11-18 12:43:00 +0800 CST
程序员茄子在线接单