search

Home  >  Q&A  >  body text

Setting the Width of the Code Box (PrismJS): A Guide to Practical Tips

<p>So I'm basically trying to set a width for a code box (I'm using prismJS) and when I add too much code it causes everything to break and the width and height to increase. I want to be able to specify the width and height so if the code is too long it just adds a scrollbar. </p> <p>This is the size I want the code box to be: Image</p> <pre class="brush:php;toolbar:false;"><div class="container"> <div class="post-header">SOME HEADER</div> <div class="post-content"> <p> <pre><code class="language-js"> </code></pre> <p> <img class="image-content"> <div class="post-content"> </div> </div></pre></p>
P粉392861047P粉392861047497 days ago684

reply all(1)I'll reply

  • P粉807239416

    P粉8072394162023-09-02 10:55:44

    You need to add a CSS property to your code box

    overflow: scroll;

    reply
    0
  • Cancelreply