Archived topic
HTML to GB blocks. Is it possible?
5 replies · Started by Marcel on August 6, 2022
I found some HTML+CSS code that allows me to create a slider. I wonder if it would be possible to transpose their divs from HTML to GB blocks, give them their respective CSS classes and get the same end result. Here is the Codepen snippet:https://codepen.io/alvarotrigo/pen/bGqgqeK
More details on the private area.
Thank you.
Marcel
Hi Marcel,
Unfortunately it will require quite a bit of custom coding to implement the Codepen solution with GB.
I would recommend either find a slider plugin that works well or just go with the exact solution provided by CodePen.
Hello again,
Leo, I tried to "adapt" somehow Codepen's solution to my needs. Although I managed to get the containers to slide, I still need a little help with the CSS (I'm sure it's something straightforward, but I'm really bad with CSS at the moment).
As you can see in this recording, the main container "jumps" to the top when I try to go to the next slide.
Do you think you can help me with some CSS here?
In the private area is the URL address where I made this experiment.
Thank you.
That's normal behavior, as when you click on a number, it takes you to the HTML anchor (you will notice it at the end of the URL).
It's not something that CSS can fix.
Hello Ying,
Yes, it should "jump" to the next URL, but inside the main container. I have to make the main container to stay "fixed" on page.
I am sorry, but this is not the normal behaviour.
On the other side, I know my problem is not directly related to Generatepress support, so no worries.
I love you, guys, even I didn't get the desired answer.
I will mark this topic as "resolved" even it is not.
All the best
Marcel
I'm telling you it's normal behavior not because it's not related to GP, but it is normal behavior based on the method you are using :)