Jump to content

Custom text colour for one block changing the colour of correct block plus another block

Go to solution Solved by Beyondspace,

Recommended Posts

Site URL: https://africanaeconomics.com/diverse-economies-for-youth

https://africanaeconomics.com/diverse-economies-for-youth

Most of the text on the website i would like to be black, so i have the code.

<style>
/* Hide Header */
.Header {
    display: none !important;
}
  .Main {
background-color: white !important;
  }
  p {
    color: black !important;
  font-family: Optima, sans-serif;!important;
}
  </style>

 

There is one block of text i want to be white so i put in the code.

<style> 
  /*Font Colours*/
#block-yui_3_17_2_1_1665779804803_49707
h1 { 
  color: White;!important;
  font-family: Optima, sans-serif;!important;
}
   p {
    color: white !important;
    font-family: Optima, sans-serif;!important;
}
  
</style>

The problem is the code for the block of text i want to be white is turning the text of another block white as well.

Again this is the page https://africanaeconomics.com/diverse-economies-for-youth

Any body know what i'm doing wrong?

Thanks so much

Screen Shot 2022-10-14 at 5.51.19 PM.png

Edited by JTeich
Link to comment
5 hours ago, JTeich said:

Site URL: https://africanaeconomics.com/diverse-economies-for-youth

https://africanaeconomics.com/diverse-economies-for-youth

Most of the text on the website i would like to be black, so i have the code.

<style>
/* Hide Header */
.Header {
    display: none !important;
}
  .Main {
background-color: white !important;
  }
  p {
    color: black !important;
  font-family: Optima, sans-serif;!important;
}
  </style>

 

There is one block of text i want to be white so i put in the code.

<style> 
  /*Font Colours*/
#block-yui_3_17_2_1_1665779804803_49707
h1 { 
  color: White;!important;
  font-family: Optima, sans-serif;!important;
}
   p {
    color: white !important;
    font-family: Optima, sans-serif;!important;
}
  
</style>

The problem is the code for the block of text i want to be white is turning the text of another block white as well.

Again this is the page https://africanaeconomics.com/diverse-economies-for-youth

Any body know what i'm doing wrong?

Thanks so much

Screen Shot 2022-10-14 at 5.51.19 PM.png

You want to set style for h1 and tag in  #block-yui_3_17_2_1_1665779804803_49707 ,right?

You should use the following code on Home > Design > Custom Css (not in the code injection)

#block-yui_3_17_2_1_1665779804803_49707 {
  h1 {
    color: White !important;
    font-family: Optima, sans-serif;
  }
  p {
    color: white !important;
    font-family: Optima, sans-serif;
  }
}

 

Edited by bangank36

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Keyword Highlighter
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment
45 minutes ago, bangank36 said:

You want to set style for h1 and tag in  #block-yui_3_17_2_1_1665779804803_49707 ,right?

You should use the following code on Home > Design > Custom Css (not in the code injection)

#block-yui_3_17_2_1_1665779804803_49707 {
  h1 {
    color: White;
    !important; font-family: Optima, sans-serif;
  }
  p {
    color: white !important;
    font-family: Optima, sans-serif;
  }
}

 

Putting it under Custom Css gives me an error 😕

 

Screen Shot 2022-10-14 at 11.08.30 PM.png

Screen Shot 2022-10-14 at 11.10.20 PM.png

Link to comment
  • Solution

You can check my previous code.

we get the error due to some wrong ";"

image.png.08237b0074e92c2b005ae3184d8ed95d.png

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Keyword Highlighter
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

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.