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

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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • 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.