Jump to content

Make row invisible with CSS (display: none;) - how to make it work

Go to solution Solved by melody495,

Recommended Posts

Hello,

We would like to make some rows temporarily invisible. I see that in Inspect Element that I can make it invisible with CSS display: none, but when I add this code to the CSS editor in Squarespace, it doesn't pick up on it. 
 
Can anyone point out the reason for this?
(I'm used to working with CSS in Wordpress, so maybe there are some extra tricks with Squarespace...?)
 
You can see one of these rows on the homepage: https://www.jennwert.com/ (the row with the NEW Mini-Series Offer)
Here below screenshot of the row + the CSS with display: none, which works if I tick that box in Inspect Element, but not when I paste this line of CSS Editor.
 
image.png
 
If anyone could give me a hint in the right direction, I would really appreciate it 🙂 
 
Cheers,
Vibeque
Link to comment
1 hour ago, Vibeque said:

I see that in Inspect Element that I can make it invisible with CSS display: none, but when I add this code to the CSS editor in Squarespace, it doesn't pick up on it. 

Your screenshot didn't attach. Try adding !important to your line of CSS, like so. 

... {
   display:none!important;
}

Let me know how it goes.

-------- > 👆 <---------- Please quote or @ me when replying, or I won't get a notification 

Melody | Squarespace Nerd
e: melody@melodylee.tech


💻 💁‍♀️ 1-2-1 Squarespace Training session <- feeling stuck and want to learn?
👩‍💻 💁‍♀️ Website help <- send me your to-do list. From code to plugin to domain setup.
🧰 See the tools I use (contain affiliate links)
 Did I help? I like coffee (Thank you)

Link to comment
On 4/24/2024 at 7:06 PM, melody495 said:

Your screenshot didn't attach. Try adding !important to your line of CSS, like so. 

... {
   display:none!important;
}

Let me know how it goes.

Hi Melody, 

Thanks for taking the time to reply 🙂

I tried with !important too, but I'm afraid that doesn't work either. I'm familiar working with CSS and CSS editors, but not in Squarespace. Would certain page parts not be modifiable with CSS?

I'm bascially trying to hide a row. I attach the image that didnt' show properly in my first post to show which one. May it be I have choosen the wrong div class? It would be strange, though, as it does disappear when putting the code in Inspect Element, but not when in I save it in the CSS editor, even when I add that CSS code at the very top of the CSS editor sheet.

Any other clues to what may be the reason are very welcome 🙂

Cheers,
Vibeke

 

 

Screenshot Jenn CSS not picking up.png

Link to comment
2 hours ago, Vibeque said:

I tried with !important too, but I'm afraid that doesn't work either. I'm familiar working with CSS and CSS editors, but not in Squarespace. Would certain page parts not be modifiable with CSS?

Not at all! If the CSS is correct, then it will do what you've asked it to do.

Can you check that there isn't any errors in your CSS code? If you share your code here, I can have a look at it.

-------- > 👆 <---------- Please quote or @ me when replying, or I won't get a notification 

Melody | Squarespace Nerd
e: melody@melodylee.tech


💻 💁‍♀️ 1-2-1 Squarespace Training session <- feeling stuck and want to learn?
👩‍💻 💁‍♀️ Website help <- send me your to-do list. From code to plugin to domain setup.
🧰 See the tools I use (contain affiliate links)
 Did I help? I like coffee (Thank you)

Link to comment

Hi Melody, 

Thanks for offering. 

Here is the code:

div#yui_3_17_2_1_1714482457236_154 {
    display: none !important;
}

 

Actually, I just realized that each time I fish out the code from Inspect Element, the numbers change.

I went to double check via Inspect Element, and this time I see this:

div#yui_3_17_2_1_1714482648486_154 {
    display: none !important;
}

The numbers before the _154 changes each time, which at least explains why the CSS Editor doesn't pick up, but why would the row div class change? Hmmm... curious.

I hope you know it 🙂

Thanks again!

Vibeke

Link to comment
  • Solution
13 minutes ago, Vibeque said:

I went to double check via Inspect Element, and this time I see this:

The numbers before the _154 changes each time, which at least explains why the CSS Editor doesn't pick up, but why would the row div class change? Hmmm... curious.

Ah yes. That id is dynamic, so you can't use that. I would recommend making that row into a section on its own, then you can target the static section id. 

There is a chrome plugin called Squarespace ID Finder that can help you easily get the id of a block, section, page(collection).

Hope this helps!

-------- > 👆 <---------- Please quote or @ me when replying, or I won't get a notification 

Melody | Squarespace Nerd
e: melody@melodylee.tech


💻 💁‍♀️ 1-2-1 Squarespace Training session <- feeling stuck and want to learn?
👩‍💻 💁‍♀️ Website help <- send me your to-do list. From code to plugin to domain setup.
🧰 See the tools I use (contain affiliate links)
 Did I help? I like coffee (Thank you)

Link to comment

@Vibeque You are very welcome! Happy to help 🙂 

-------- > 👆 <---------- Please quote or @ me when replying, or I won't get a notification 

Melody | Squarespace Nerd
e: melody@melodylee.tech


💻 💁‍♀️ 1-2-1 Squarespace Training session <- feeling stuck and want to learn?
👩‍💻 💁‍♀️ Website help <- send me your to-do list. From code to plugin to domain setup.
🧰 See the tools I use (contain affiliate links)
 Did I help? I like coffee (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.