class text arp top absolute char das pre
前述:
类似于京东的这种文字居中于贯穿线
代码展示:
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>
- </title>
- <style>
- *{margin:0px;padding:0px;} .wrap{width:1000px;margin:200px auto;} .grid{width:1000px;border-bottom:1px
- dashed #000;height:20px;position: relative;} .grid h3{width:100px;line-height:40px;font-size:20px;text-align:
- center;background: #fff;position: absolute;top:0px;left:500px;}
- </style>
- </head>
- <body>
- <div class="wrap">
- <div class="grid">
- <h3>
- 享品质
- </h3>
- </div>
- </div>
- </body>
- </html>
效果展示:
知识点总结:
1. 单行文字垂直居中:height=line-height,text-align:center(盒子内的文字或者图片水平居中);
2. 利用 线的 height = 文字 line-height/2,来实现文字居中贯穿线;
文字居中贯穿线
来源: http://www.bubuko.com/infodetail-2038618.html