<html> <head> <style> @media print { .h6 { text-align: left; padding-left: 30px; position: relative; z-index: 2; } .line-center { margin: 0; padding: 0 10px; background: #fff; display: inline-block; } .h6:after { content: ""; position: absolute; top: 50%; left: 0; right: 0; border-top: solid 1px lightgrey; z-index: -1; } } .h6 { text-align: left; padding-left: 30px; position: relative; z-index: 2; } .line-center { margin: 0; padding: 0 10px; background: #fff; display: inline-block; } .h6:after { content: ""; position: absolute; top: 50%; left: 0; right: 0; border-top: solid 1px lightgrey; z-index: -1; } <style> <head> <body> <h6 class="h6"><span class="line-center">Hello StackOverflow</span></h6> </body> </html>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)