Archived topic

Sticky Widget

9 replies · Started by _blank on April 17, 2021

Viewing posts 1–10 of 10

Hello

I tried a few css codes that I found in the forum but I didn't have any luck making a widget with an adsense ad code sticky.

I want to make the third widget sticky (which is a custom HTML widget with adsense code) . If that is not possible making the last widget sticky would also help.

This is the site

https://soyprofe.org/palabras-con-la-le-li-lo-lu/

Thanks

Hello

I changed my structure to Flexbox and added the CSS code in the additional CSS section of the theme but it didn't work

Hi Jose,

I have not seen the code being added to your site.

Could you clear cache and disable the cache plugin to see if that works.

Let me know :)

Hello Ying

I already deactivated the caching plugin so hopefully you can see the code now

Hi there,

You can easily make the 3rd widget sticky by adding this CSS:

aside#custom_html-3 {
    position: sticky;
    top: 0;
    z-index: 99;
}

But as David mentioned, " it will sit in front of any widgets that come after it.".

I added both codes recommended but they aren't working. What could the problem be?

The code David and I shared are both CSS.

David's CSS targets the last widget on your right sidebar. If this isn't what you want, remove this code.

On the other hand, the CSS I've provided targets the 3rd widget specifically.

It seems like there's a bit of a mistake in adding the code. I've inspected the site and the CSS syntax is broken.

Thank you.

I placed the css code on top everything that already was there and now it works.

Nice one. glad you were able to make it work.

Note: Check your other CSS for other syntax issues. I've rechecked your site and I saw the last CSS selector missing an }. It may cause an issue if you add more CSS in the future.

This archived topic is closed to new replies.