Skip to main content

Prism js horizontally overflowing its container

Sometimes we have an issue of horizontally overflowing contents in its container in prism js. You can solve it by using a CSS property.

  • Prism js horizontally overflows its container issue solution

    Code{
          white-space: pre-wrap;
    }
    

    You can use the provided code snippet to solve the issue which is found on the web page if it’s content overflows within the container using a single property in prism js. In my case i have an issue on overflowing content in PrismJS version 1.23.0 and my html element structure was like below.

    <div class="code-toolbar"> <pre class="language-css" tabindex="0"> <code class="language-css"></code> </pre> </div>
  • Back to code snippet queries related javascript