brianbyrne7 Posted October 7, 2020 Share Posted October 7, 2020 Site URL: https://chinchilla-chicken-nanw.squarespace.com/ Hi, I'm using the code below to add a line either side of headers, however I would only like to apply this to certain pages, not across the entire website. //---line either side of text--- h4 { overflow: hidden; text-align: center;} h4:before, h4:after { background-color: #333; content: ""; display: inline-block; height: 1px; position: relative; vertical-align: middle; width: 50%;} h4:before { right: 0.5em; margin-left: -50%;} h4:after { left: 0.5em; margin-right: -50%;} Thanks, Brian Link to comment
tuanphan Posted October 8, 2020 Share Posted October 8, 2020 Edit Page > Add Code Block > Paste this code <style> h4 { overflow: hidden; text-align: center;} h4:before, h4:after { background-color: #333; content: ""; display: inline-block; height: 1px; position: relative; vertical-align: middle; width: 50%;} h4:before { right: 0.5em; margin-left: -50%;} h4:after { left: 0.5em; margin-right: -50%;} </style> Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.