Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 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

How can I add a scrollbar to a code block when the code has long lines? For an example, look at the code block of this question.

share|improve this question
A scrollbar is added automatically when the length of any line in the code block exceeds the width of the block. One was added in this answer of yours, for instance. – Michael Petrotta Nov 9 '12 at 7:08
Except on mobile, which wraps long lines. – Arjan Nov 9 '12 at 7:21
@MichaelPetrotta: Oh i got it now. But when I created a block using ">" it doesn't add a scrollbar. Am I correct? – prageeth Nov 9 '12 at 7:52
That is not a code block. That is a blockquote. Those are different things. – Bart Nov 9 '12 at 8:01
see: How do I format my code blocks? "What do I need to do so that my code shows up properly..." – gnat Nov 9 '12 at 8:59
@gnat : Thanks, your comment is really helpful. – prageeth Nov 9 '12 at 10:14
up vote 1 down vote accepted

As the commenters on your question said, this happens automatically. There are however some scripts available on StackApps which improve the usability of the code blocks in general:

share|improve this answer

You must log in to answer this question.

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