当前位置: 首页 > news >正文

html 给文本两端加虚线自适应

效果图:

<div class="separator">
    文本
</div>

.separator {
  width: 40%;
  border-style: dashed;
  display: flex;
  align-items: center;
  color: #e2e2e2;
  font-size: 14px;
  line-height: 20px;
  border-color: #e2e2e2;
  border-width: 0;
}

.separator::before {
  content: '';
  flex: 1;
  box-sizing: border-box;
  height: 1px;
  border-color: inherit;
  border-style: inherit;
  border-width: 2px 0 0;
  margin-right: 5px;
  padding: 0;
  outline: none;
}

.separator::after {
  content: '';
  flex: 1;
  box-sizing: border-box;
  height: 1px;
  border-color: inherit;
  border-style: inherit;
  border-width: 2px 0 0;
  margin-left: 5px;
  padding: 0;
  outline: none;
}

http://www.dtcms.com/a/112890.html

相关文章:

  • MySQL学习笔记(三)——图形化界面工具DataGrip
  • 深入解析C++智能指针:从内存管理到现代编程实践
  • Swagger @ApiOperation
  • Qt之QNetworkInterface
  • 低代码开发平台:飞帆中的控件中转区
  • AI Agent设计模式三:Routing
  • 智能合约的法律挑战与解决之道:技术与法律的交融
  • 《P1072 [NOIP 2009 提高组] Hankson 的趣味题》
  • 小米BE3600路由器信息
  • 【愚公系列】《高效使用DeepSeek》053-工艺参数调优
  • [ctfshow web入门] web5
  • MySQL表结构导出(Excel)
  • 状态模式~
  • 【蓝桥杯】十五届省赛B组c++
  • 神经网络入门:生动解读机器学习的“神经元”
  • C++ KMP算法
  • Leetcode - 双周赛153
  • 失眠睡不着运动锻炼贴士
  • Mac强制解锁APP或文件夹
  • Java的Selenium常用的元素操作API
  • 【图像处理基石】什么是AWB?
  • 扩展库Scrapy:Python网络爬虫的利器
  • 【Rust学习】Rust数据类型,函数,条件语句,循环
  • 实战打靶集锦-38-inclusiveness
  • pyTorch框架使用CNN进行手写数字识别
  • AI比人脑更强,因为被植入思维模型【43】蝴蝶效应思维模型
  • 多模态智能体框架MM-StoryAgent:跨模态叙事视频生成的技术突破
  • 九、重学C++—类和函数
  • QGIS中第三方POI坐标偏移的快速校正-百度POI
  • C#编程基础知识点介绍