Loading...
 
Skip to main content

Themes


size of Code-block on Tikipedia

Hi,

I want to resize the codeblock, that it is as wide as the content-block might be.

Copy to clipboard
.codelisting { font-family: "Courier New", Courier, monospace; padding: 11px; font-size: 1em; line-height: 115%; color: #3A3A3A; background: #F9F9F9; padding-bottom: 22px; border: 1px dashed #999; overflow: auto; width: 600px !important; /*I THINK THESE IS THE SETTING TO CHANGE*/ min-width: 600px !important; white-space: pre; }


Is it possible to handle this setting, that the Code block fits the size of the content-block ?

Yes, try setting the width to 100% or auto.

-- Gary


100% I tried that won't work, then the code block is much bigger, and the page needs to be scrolled.
Auto doesn't work too. The size is, I think, ~70% of the content-block. when an line is linger in the code-block, it needs to be scrolled.


What browser are you using? My goal was for the code div to be width of the center column, and have a scrollbar if its contents are wider than that. Unfortunately, this doesn't work as expected in Firefox. That's why I gave the div a specific width instead. I don't have time at the moment to look into this now but suggest you check the page with other themes and see if any are handling this better, and if so, try using their rule for the code block width. Also, try using the 'wrap=1' parameter in the code plugin to see if it helps.

-- Gary


I'm using Firefox.
Now I set it to Auto, the width is about 70% and if the code is longer, scrollbars appear. but for scrolling left-right, I must scroll down the whole code, because the scrollbars are at the bottom, unfavourable.


You can click in the code area and then use the keyboard arrow keys, I believe, to move the code text horizontally . If you don't want a scrollbar on the code area at all (and so a wider page, so a scrollbar at browser window bottom), then remove the 'overflow:auto' property.

-- Gary