Jump to content

How do I write address code for a page other than a homepage?

Go to solution Solved by Web_Solutions,

Recommended Posts

Hi, I have CSS code I want to use in a page of mine. I want to use the code not on my homepage but in my page named: test

But as you can see the code was used in my previous homepage:
 body.homepage but how do I change it (word it) so the code works in my page named: test

Should it read?
{
body.test {
.header-title-logo a:after {
  content: "CONTEMPORARY ARTIST";
position: absolute; 

{
body.homepage {
.header-title-logo a:after {
  content: "CONTEMPORARY ARTIST";
position: absolute;
top: calc(~"70% + 70px");
left: 50%;
transform: translate(-50%,-50%);
z-index: 9999;
font-size: 48px;
color: white;
width: 100%;
text-align: center;
font-weight: 500;
letter-spacing: .6rem;
text-shadow: #999 0px 0 0px;
}
Link to comment
1 hour ago, lornem said:

Hi, I have CSS code I want to use in a page of mine. I want to use the code not on my homepage but in my page named: test

But as you can see the code was used in my previous homepage:
 body.homepage but how do I change it (word it) so the code works in my page named: test

Should it read?
{
body.test {
.header-title-logo a:after {
  content: "CONTEMPORARY ARTIST";
position: absolute; 

{
body.homepage {
.header-title-logo a:after {
  content: "CONTEMPORARY ARTIST";
position: absolute;
top: calc(~"70% + 70px");
left: 50%;
transform: translate(-50%,-50%);
z-index: 9999;
font-size: 48px;
color: white;
width: 100%;
text-align: center;
font-weight: 500;
letter-spacing: .6rem;
text-shadow: #999 0px 0 0px;
}

You can add the code any page like this. Just you need to find the page Body's ID. You can find ID by Inspecting the page. I have shown on the attached image.

body#collection-656a401a453247712d1d0e5b {
  .header-title-logo a:after {
    content: "CONTEMPORARY ARTIST";
    position: absolute;
    top: calc(~"70% + 70px");
    left: 50%;
    transform: translate(-50%,-50%);
    z-index: 9999;
    font-size: 48px;
    color: white;
    width: 100%;
    text-align: center;
    font-weight: 500;
    letter-spacing: .6rem;
    text-shadow: #999 0px 0 0px;
  }
}

 

Screenshot_472.png

Screenshot_471.png

Edited by Web_Solutions

If my comments are useful, please like and mark my solution as answer. It will encourage me. Thanks

MD Rofik
Website Designer and Digital Marketer

Am I helpful? Want to offer me a coffee?
Send me a message if needed any help. I'll try to reply as soon as possible.


 

Link to comment

Ok thanks. Do I copy just the #ID Number or all the code below it too?

Please tell me if this code is correct?

OK, my ID Number is: id="collection-6568a75112118c18ed22f78e"

I added it to the code below. Does this look correct?

{
body id="collection-6568a75112118c18ed22f78e" {
.header-title-logo a:after {
  content: "CONTEMPORARY ARTIST";
position: absolute;
top: calc(~"70% + 70px");
left: 50%;
transform: translate(-50%,-50%);
z-index: 9999;
font-size: 48px;
color: white;
width: 100%;
text-align: center;
font-weight: 500;
letter-spacing: .6rem;
text-shadow: #999 0px 0 0px;
}
Edited by lornem
Link to comment
1 minute ago, lornem said:

Ok thanks. Do I copy just the #ID Number or all the code below it too?

Please tell me if this code is correct?

OK, my ID Number is: id="collection-6568a75112118c18ed22f78e"

I added it to the code below. Does this look correct?

{
body#collection-6568a75112118c18ed22f78e {
.header-title-logo a:after {
  content: "CONTEMPORARY ARTIST";
position: absolute;
top: calc(~"70% + 70px");
left: 50%;
transform: translate(-50%,-50%);
z-index: 9999;
font-size: 48px;
color: white;
width: 100%;
text-align: center;
font-weight: 500;
letter-spacing: .6rem;
text-shadow: #999 0px 0 0px;
}

You put it in the wrong place. This is the right way to put the id

body#collection-6568a75112118c18ed22f78e {
  .header-title-logo a:after {
    content: "CONTEMPORARY ARTIST";
    position: absolute;
    top: calc(~"70% + 70px");
    left: 50%;
    transform: translate(-50%,-50%);
    z-index: 9999;
    font-size: 48px;
    color: white;
    width: 100%;
    text-align: center;
    font-weight: 500;
    letter-spacing: .6rem;
    text-shadow: #999 0px 0 0px;
  }
}

 

Screenshot_474.png

If my comments are useful, please like and mark my solution as answer. It will encourage me. Thanks

MD Rofik
Website Designer and Digital Marketer

Am I helpful? Want to offer me a coffee?
Send me a message if needed any help. I'll try to reply as soon as possible.


 

Link to comment
  • Solution
Just now, lornem said:

Ok, Thanks. I changed it but I see nothing.. No type. Nothing has changed on the page. 

Can you share the page URL?

If my comments are useful, please like and mark my solution as answer. It will encourage me. Thanks

MD Rofik
Website Designer and Digital Marketer

Am I helpful? Want to offer me a coffee?
Send me a message if needed any help. I'll try to reply as soon as possible.


 

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.