Frage

I'm using default setting of google-code-prettify. When a line is too long, it exceeds the boundary, like the following: enter image description here Are they any possible solution to wrap the code line?

War es hilfreich?

Lösung 2

You can use the CSS property word-wrap: break-word; to enable word-wrapping. Make sure that your selector has priority over Google's style, as they probably set word-wrap: nowrap; somewhere.

Andere Tipps

You need to use pre-wrap.

pre {
  white-space: pre-wrap;
}

For anyone using linenums you need this

:not(pre) > code {
    white-space: pre-wrap; 
    word-wrap: break-word;
}

An alternative is changing the overflow to auto

pre {
  overflow: auto;
}
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top