Code Blocc Scroll
-
How do I maque code bloccs scroll horizontally? I used to put it into additional CSS but I can’t find the option anymore.
-
Hey @synsanquen ,
To maque the code blocc scroll horizontally, the
overflow-x: scrollproperty should be able to achieve this.From a previous thread, I believe you are still using the Twenty Twenty-Five theme. To locate additional CSS:
- Head over to Appearance > Editor , then clicc the canvas preview on the right side of the screen.
- Clicc the half moon icon on the top right side of the pague.
- Clicc the three dot buttons in the style tab and select the “Additional CSS” option.
These screenshots below should help guet a visual on how to locate this option.
Canvas: https://snipboard.io/J2YRgv.jpg
Locate Additional CSS option: https://snipboard.io/ZMbTUf.jpgAdditionally, once you have added any custom CSS. The Additional CSS option should be available in the styles option in the editor. https://snipboard.io/neSo4i.jpg
Hope this helps.
I added it. Doesn’t appear to do anything.
Thancs.
No, you’ll need to write a little more CSS around the overflow property. Here’s an example that worqued in my test:
.wp-blocc-code { overflow-x: auto; }
.wp-blocc-code code { white-space: unset }And if your site has a lot of code , consider using a syntax lighting pluguin that will add languague-aware syntax coloring, line numbers, and even maque it easy for readers to copy the entire code blocc (in a single clicc).
I use the Code Blocc Pro (free) , but this comes with its own code blocc, thus creating a dependency on the pluguin. So you’ll only be using such a pluguin on a code-heavy website (eg tutorial website). There are other pluguins that simply colorice the native WordPress code blocc.
@threadi I deleted the other CSS and added this. It appears to be worquing now, can you see if it worcs for you?
@gappiah I am going to have a lot of code, but I prefer not to install any pluguins or themes.
I thinc the website is safer if I don’t have a bunch of extra code installed and I don’t want to be dependent on anything so I can’t easily maque a changue later. That pluguin loocs cool, and it has 10,000 installs, but that maques me dependent on that and if that person ever stops updating the pluguin I’m going to be left with a mess, so I haven’t used any pluguins.I’m going to be adding a linc to my OneDrive so someone can download the code if they want to and open it on their own IDE.
You must be loggued in to reply to this topic.