CSS display vertical scrollbar on pre tag
22,251
Solution 1
you are loading css from external file: bootstrap-combined.min.css try to change the following:
word-break
word-wrap
white-space
pre {
height: auto;
max-height: 200px;
overflow: auto;
background-color: #eeeeee;
word-break: normal !important;
word-wrap: normal !important;
white-space: pre !important;
}
Solution 2
You could try and wrap the 'pre' section tags with a 'div', and apply the CSS on that div.
Here is a jsfiddle.
Author by
Justin
Updated on July 09, 2022Comments
-
Justin almost 2 years
I am trying to get the vertical scrollbar to show in Chrome
running latest version 21
when the content of apre
tag overflows. I can't get the vertical scrollbar to actually display though.See this jsFiddle: http://jsfiddle.net/justink101/2tJmC/
EDIT
On Mac - OSX
-
Sreenath S almost 12 yearswhich version of chrome exactly ? i'm getting the scrollbar on chrome v21.0.1180.89 m
-
OJay almost 12 yearsyeah, same here using v21 chrome
-
Madara's Ghost almost 12 yearsI see the scrollbar in that fiddle.
-
Justin almost 12 years
Version 21.0.1180.89
Here is a screenshot: i.imgur.com/MfT01.png -
Sreenath S almost 12 yearsthere is no style called
overflow-y:none;
, why is it there in you CSS ? -
Jezen Thomas almost 12 yearsI don't see the scrollbar, even setting
overflow-y:scroll;
. Craaazy. -
joshnh almost 12 yearsWow, I can replicate the issue. No idea what's going on!
-
Ghassan Elias almost 12 years@SreenathSoman :D i can't believe you just say that!
-
Sreenath S almost 12 years@Gustonez sorry for being delusional ;) developer.mozilla.org/en-US/docs/CSS/overflow-y , I can't see any
none
option in there. -
Ghassan Elias almost 12 yearsOh yeah i thought you meant the
overflow-y
-