Bootstrap: Horizontally-scrolled <pre> blocks

Created on 29 Apr 2012  路  6Comments  路  Source: twbs/bootstrap

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.

Most helpful comment

+1, here is here I fixed it:

pre {
    overflow-x: auto;
}

pre code {
    word-wrap: normal;
    white-space: pre;
}

All 6 comments

Not something we'll solve in the core for now. If it was a larger problem, I feel we'd get more issues opened :). Thanks for the suggestion though!

Realize this is old, but I'm :+1: on this.

I'm :+1: too

m 2

+1

+1, here is here I fixed it:

pre {
    overflow-x: auto;
}

pre code {
    word-wrap: normal;
    white-space: pre;
}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

IamManchanda picture IamManchanda  路  3Comments

ziyi2 picture ziyi2  路  3Comments

athimannil picture athimannil  路  3Comments

vinorodrigues picture vinorodrigues  路  3Comments

knownasilya picture knownasilya  路  3Comments