摘要: 单行文本换行 效果:强制文本单行显示,超出部分显示省略号 ​ 核心属性: white-space: nowrap + overflow: hidden + text-overflow: ellipsis ​ 代码示例 .text-nowrap { width: 200px; white-space: 阅读全文
posted @ 2026-05-07 08:06 nneeyy 阅读(5) 评论(0) 推荐(0)
摘要: 单行文本垂直居中(行高法) 适用场景:固定高度、单行文本 ​ 核心原理: line-height 值 = 容器 height 值 代码示例 ​.box-line { width: 300px; height: 80px; line-height: 80px; /* 核心:行高 = 容器高度 / bo 阅读全文
posted @ 2026-05-07 08:05 nneeyy 阅读(4) 评论(0) 推荐(0)
摘要: .top{ width: 500px; height: 200px; /*line-height: 200px;*/ background-color: cyan; align-items: center; display: flex; } </style> </head> <body> <div 阅读全文
posted @ 2026-04-30 09:23 nneeyy 阅读(3) 评论(0) 推荐(0)
摘要: hello </div>--> <div class='parent'> <div class="son"></div> <div class="son"></div> <div class="son"></div> <div class="son"></div> </div> </body> 作业 阅读全文
posted @ 2026-04-19 20:06 nneeyy 阅读(4) 评论(0) 推荐(0)
摘要: 左右 body{ color: #fff; font-family: "微软雅黑"; font-size: 48px; } .parent{ margin: 0 auto; text-align: center; line-height: 500px; } .left{ float: left; b 阅读全文
posted @ 2026-04-13 07:55 nneeyy 阅读(4) 评论(0) 推荐(0)
摘要: 3月26 一,插入图片 Tips 1.图片一定要放到项目里的img文件 2.图片的格式:在保证成像质量的前提下,文件越小越好 常见的图片格式有: JPG:颜色丰富 GIF:支持动画显示 png:支持透明背景 最新的两种: svg webp 插入图片的格式: <img src="img/asd.png 阅读全文
posted @ 2026-03-30 08:03 nneeyy 阅读(1) 评论(0) 推荐(0)
摘要: 我的网站 欢迎来到我的网站 这是一个简单的演示页面 <p>&nbsp;sad</p> <!--换行符--> <br /> <p>rice</p> <!--把标题一变得和标题六一样大--> <h1>标题一</h1> <h6>标题六</h6> </body> 阅读全文
posted @ 2026-03-22 18:49 nneeyy 阅读(8) 评论(0) 推荐(0)
摘要: 三月十二** 一,标签不区分大小写 大小写仅为增加可阅读性 二,HTML标记 1.带<>称为HTML标记,标签 2.标签分为单标签和双标签 3.定义选项卡的内容 4.后面写内容 5.插入一条水平线 6.align对齐 7.hidden隐藏 阅读全文
posted @ 2026-03-15 21:41 nneeyy 阅读(3) 评论(0) 推荐(0)
摘要: ` 实时系统时间显示 <script> // 获取显示时间的DOM元素 const timeElement = document.getElementById('currentTime'); // 定义格式化时间的函数 function formatDateTime() { // 获取当前系统时间 阅读全文
posted @ 2026-03-12 08:07 nneeyy 阅读(5) 评论(0) 推荐(0)