Jump to content

How do I apply this custom code to 1 page only? It's currently applying across my entire site

Recommended Posts

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
  • Replies 1
  • Views 309
  • Created
  • Last Reply

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.