Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 155 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

I have noticed that when we use code markups, the code gets re-formatted and syntax-highlighted; but if a block of code of say, 100 lines, is posted, all the lines are visible.

Instead, what about using the vertical scrollbar and limiting the code snippet size to a fixed maximum length, say 20 lines, allowing the user to see the rest of the code using the scrollbar?

share|improve this question
    
See also meta.stackexchange.com/questions/36979/… – nb69307 Jun 9 '10 at 11:47

I think this happens already. Take a look at this question for an example of a question with a large block of code posted.

share|improve this answer

Mike's correct, this is already the default behavior, are you using some custom script or stylesheet that's overriding the overflow: auto; on the <pre> element, or possibly using a browser that doesn't support max-height?

The relevant styling (as of the time of this post) is this:

pre {
  max-height: 600px;
  overflow: auto;
  width: auto;
}
share|improve this answer
    
Related: stackoverflow.com/questions/7707/… and specifically Jeff's answer. – Grace Note Jun 9 '10 at 11:48
    
@ccomet: Ah IE, the special kid...I'd call this a non-issue, an inferior browser will yield an inferior experience, same goes for buying a car (though it's a free choice here, and by inferior I mean in terms of supporting these CSS properties). I wouldn't say this is broken, it works, it just isn't the optimal experience. – Nick Craver Jun 9 '10 at 12:00
    
It isn't always a free choice. – mmyers Jun 9 '10 at 21:52
    
@mmyers - I meant cost-wise :) I understand it may be a limited choice, I have several friends in that situation where they work. – Nick Craver Jun 10 '10 at 1:04
    
Thanks guys, I am using IE7. Let me try the same with some other browsers. – bdhar Jun 22 '10 at 4:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .