lornem Posted December 1, 2023 Share Posted December 1, 2023 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
Web_Solutions Posted December 1, 2023 Share Posted December 1, 2023 (edited) 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; } } Edited December 1, 2023 by Web_Solutions Kobir 1 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
lornem Posted December 1, 2023 Author Share Posted December 1, 2023 (edited) 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 December 1, 2023 by lornem Link to comment
Web_Solutions Posted December 1, 2023 Share Posted December 1, 2023 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; } } Kobir 1 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
lornem Posted December 1, 2023 Author Share Posted December 1, 2023 Ok, Thanks. I changed it but I see nothing.. No type. Nothing has changed on the page. Link to comment
Solution Web_Solutions Posted December 1, 2023 Solution Share Posted December 1, 2023 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
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment