Many a times even when not required, a vertical scroll gets added to your code as shown here:
The scroll appears in some browsers (especially Chrome) as the default style set in shCoreDefault.css is overflow: auto. If you do not want a vertical scrollbar, you can always do this:
.syntaxhighlighter { overflow-y: hidden !important; }
The overflow-y property specifies what to do with the edges of the content if it overflows the element's content area. Setting this to hidden will make the vertical scrollbar disappear. You do not have to add a style for the horizontal scroll bar as it already exists in shCoreDefault.css.
If for some reason, the scroll does not disappear even after setting the overflow-y property then prefix the class with a container class. For eg: my code blocks are contained in a div with ‘code’ class. In this case, I can prefix the class as follows:
.code .syntaxhighlighter { overflow-y: hidden !important; }
and you will find that the vertical scrollbar now disappears.
Tweet
No comments:
Post a Comment