Jump to content

Css Code applies in editor but not on live page

Go to solution Solved by creedon,

Recommended Posts

Password: bconsult

The code reveal text on a hover code works in my editor view but not in live view when I access the page from the front ed. Here i the doe I am using: 

 

@media only screen and (min-width: 640px){
#block-50a60eabf9b7879fd7ec{
opacity: 0;
 transition: opacity 1s
}
#block-50a60eabf9b7879fd7ec:hover {
opacity: 1;
transition: opacity 1s
}
}
@media only screen and (min-width: 640px){
#block-b9c394e42cbe4f0614b7{
opacity: 0;
 transition: opacity 1s
}
#block-b9c394e42cbe4f0614b7:hover {
opacity: 1;
transition: opacity 1s
}
}
@media only screen and (min-width: 640px){
#block-8ac8af888d0f13c5a5f5{
opacity: 0;
 transition: opacity 1s
}
#block-8ac8af888d0f13c5a5f5:hover {
opacity: 1;
transition: opacity 1s
}
}
@media only screen and (min-width: 640px){
#block-207b0fa7a755d1b13c8a{
opacity: 0;
 transition: opacity 1s
}
#block-207b0fa7a755d1b13c8a:hover {
opacity: 1;
transition: opacity 1s
}
}
@media only screen and (min-width: 640px){
#block-1559eef8f75e1479225a{
opacity: 0;
 transition: opacity 1s
}
#block-1559eef8f75e1479225a:hover {
opacity: 1;
transition: opacity 1s
}
}
@media only screen and (min-width: 640px){
#block-ad4977c97fa2f8f9cc87{
opacity: 0;
 transition: opacity 1s
}
#block-ad4977c97fa2f8f9cc87:hover {
opacity: 1;
transition: opacity 1s
}
}

 

 

Link to comment
  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

On 12/22/2022 at 3:36 AM, CKW_242 said:

Password: bconsult

The code reveal text on a hover code works in my editor view but not in live view when I access the page from the front ed. Here i the doe I am using: 

 

@media only screen and (min-width: 640px){
#block-50a60eabf9b7879fd7ec{
opacity: 0;
 transition: opacity 1s
}
#block-50a60eabf9b7879fd7ec:hover {
opacity: 1;
transition: opacity 1s
}
}
@media only screen and (min-width: 640px){
#block-b9c394e42cbe4f0614b7{
opacity: 0;
 transition: opacity 1s
}
#block-b9c394e42cbe4f0614b7:hover {
opacity: 1;
transition: opacity 1s
}
}
@media only screen and (min-width: 640px){
#block-8ac8af888d0f13c5a5f5{
opacity: 0;
 transition: opacity 1s
}
#block-8ac8af888d0f13c5a5f5:hover {
opacity: 1;
transition: opacity 1s
}
}
@media only screen and (min-width: 640px){
#block-207b0fa7a755d1b13c8a{
opacity: 0;
 transition: opacity 1s
}
#block-207b0fa7a755d1b13c8a:hover {
opacity: 1;
transition: opacity 1s
}
}
@media only screen and (min-width: 640px){
#block-1559eef8f75e1479225a{
opacity: 0;
 transition: opacity 1s
}
#block-1559eef8f75e1479225a:hover {
opacity: 1;
transition: opacity 1s
}
}
@media only screen and (min-width: 640px){
#block-ad4977c97fa2f8f9cc87{
opacity: 0;
 transition: opacity 1s
}
#block-ad4977c97fa2f8f9cc87:hover {
opacity: 1;
transition: opacity 1s
}
}

 

 

What is your URL Site?

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, Lightbox Studio plugin
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
  • Solution

Try the following.

/* image hover effect, uses LESS syntax */

@media only screen and ( min-width : 640px ) {

  html:not( .squarespace-damask ) {
  
    .fe-block-50a60eabf9b7879fd7ec,
    .fe-block-b9c394e42cbe4f0614b7,
    .fe-block-8ac8af888d0f13c5a5f5,
    .fe-block-1559eef8f75e1479225a,
    .fe-block-207b0fa7a755d1b13c8a,
    .fe-block-ad4977c97fa2f8f9cc87
    
      {
      
        opacity : 0;
        transition : opacity 1s;
        
        &:hover {
        
          opacity : 1;
          
          }
          
        }
        
    }
    
  }

One thing to note. I made it so the code would not be active in Preview as that might interfere the editing process. To view the effect you'll need to use Private browsing.

Let us know how it goes.

Edited by creedon

Find my contributions useful? Please like, upvote, mark my answer as best , and see my profile. Thanks for your support!

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.