Demo—标题左右两侧的对等横线
2024-10-16 08:43:16
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>各种类型的线条</title>
<style type="text/css">
*{
margin: 0;
padding: 0;
}
.container{
height: 100px;
font-size: 24px;
font-weight: bold;
background: #f3f3f3;
margin-bottom: 30px;
text-align: center;
line-height: 100px;
}
.line_one h3{
vertical-align: middle;
text-align: center;
line-height: 100px;
}
.line_one h3 span{
vertical-align: middle;
display: inline-block;
padding: 0 50px;
}
.line_one h3:before,.line_one h3:after{
display: inline-block;
vertical-align: middle;
content: "";
width: 100px;
height: 3px;
background: #000000; }
.line_two span{
letter-spacing: -1px; //通过设置字符间距是线之间的空白消失
}
.line_two strong{
padding: 0 50px;
}
</style>
</head>
<body>
<div class="container line_one">
<h3><span>世界那么大</span></h3>
</div>
<div class="container line_two">
<h3>
<span>—————————</span>
<strong>世界那么大</strong>
<span>—————————</span>
</h3>
</div>
<div class="container line_four"> </div>
<div class="container line_five"> </div>
<div class="container line_six"> </div>
<div class="container line_seven"> </div>
</body>
</html>
最新文章
- 【php学习】PHP 入门经典第一章笔记
- C# 与 Java 中的枚举
- php+jquery+ajax实现用户名验证
- numpy使用
- RVM 实用指南
- bzoj 1798 [Ahoi2009]Seq 维护序列seq
- 分享一个自己用的Objective-C的Http接连类
- 推荐15个月 Node.js 开发工具
- [LeetCode107]Binary Tree Level Order Traversal II 二叉树层次遍历
- geoserver发布地图服务WMTS
- java内存结构
- class的真相
- Linux 之父自传《just for fun》读书笔记
- Dapper简易教程(翻译自Github上StackExchange/Dapper)
- 给tomcat 配置https
- JMS学习(七)-ActiveMQ消息的持久存储方式之KahaDB存储
- CAS 策略已被 .NET Framework 弃用
- 每日英语:How To Survive The Windows XPiration Date
- [development][libhtp] libhtp 启用debug模式
- 【JVM】内存分析<;一>;工具的使用