question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Horizontally-scrolled <pre> blocks

See original GitHub issue

It took me some time to figure out how to tweak bootstrap so that my <pre> blocks scroll horizontally instead of getting wrapped. I personally can’t stand word-wrapped code blocks - it makes code confusing to read, and I suspect many programmers are in the same boat (Octopress’s default code block scrolls horizontally).

I suggest either:

  1. Make horizontally-scrolled <pre> blocks the default, -OR-
  2. Split the .pre-scrollable class into a .pre-x-scrollable and .pre-y-scrollable class, which will enable scrolling in either direction.

I can create a pull request for either case, but first I want to make sure there are not other plans for this or it hasn’t been done in other branches.

Issue Analytics

  • State:closed
  • Created 11 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
mmoreycommented, May 7, 2013

+1, here is here I fixed it:

pre {
    overflow-x: auto;
}

pre code {
    word-wrap: normal;
    white-space: pre;
}
0reactions
cvrebertcommented, Mar 20, 2013

+1

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to make Twitter Bootstrap's <pre> blocks scroll ...
The trick is that bootstrap overrides both the white-space and the CSS3 word-wrap attributes for the <pre> element. To achieve horizontal scrolling, ...
Read more >
Horizontal scrolling and you - rabexc.org
I wanted to have a <pre> block, with code that: had an horizontal scroll bar. but only when there are lines too long....
Read more >
Horizontal scrolling for <pre> elements: just not getting it : r/css
My page has code samples in <pre> elements. I want those elements to have horizontal scroll bars when they're wider than the screen....
Read more >
Horizontal scrolling in code blocks - John Jetmore
Horizontal scrolling in code blocks ... Then I can get the nice boxes by surrounding code snippets with both pre and code blocks....
Read more >
Stackable Blocks Causes Horizontal Scrolling - WordPress.org
Not sure what is happening but when I import a Design Library block or even create a ... When I ungroup from Container,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found