Could the max-height on code examples on this forum be disabled?

There’s a CSS rule on pre code that sets a max-height of 500px. This means that when you’re scrolling through a topic, you also have to scroll through sub-elements to see all the content. To me, this is annoying enough on a desktop browser, but it can be particularly tedious and surprising on a mobile phone.

Does anyone else think that this is important behavior to maintain? Could the CSS on this forum be customized to get rid of that max-height constraint?


I agree. On mobile, I frequently find myself hunting for a sliver of non-pre code area so I can scroll the post rather than the code example I might not be interested in.


Third option: maybe keep the max-height, but disable scrolling within the <pre>, and add a button below that increases the max-height by 700px.

(I don’t know how easy this is technically. But I’m sure a lot of other forums would also benefit from it.)

I like bgeronns suggestion. Give them a max-size with a button to see all of it. That way they don’t interfere with scrolling and you can still see the whole code if you want to

1 Like

Same here, the “nested” scrolling on mobile can be quite annoying.

I’m not sure if taking away the max-height (i.e. always fully expanding the code blocks) is the correct solution though…
It would simply collapse all the currently-nested scrollbars into one huge scrollbar for the entire topic. Basically, We’d always have to scroll the entire post; no more “slivers of non-pre” to hunt for :frowning:

A “show all” button as bgeron suggests seems like a great solution, combining the best of both worlds: limited height to scroll past in the normal case, and full scrollability (using the standard “whole-topic” scrollbar) on-demand.