如何通过强制文本溢出使简单的预代码片段响应?

问题描述

我认为这应该很简单。

我会让这段代码只是滚动滚动文本,但似乎我缺少明显的东西。

如果正文小于预代码的文本,我如何找到一种在代码片段上溢出文本的方法

https://codepen.io/vittoriovittori/pen/XWdMyRP

CSS

div {
  border: 1px solid;
}

pre {
  background-color: grey;
  padding: 10px;
  overflow: scroll;
}

code {
  background: pink;
}

.grid {
  display: grid;
  grid-template-columns: 100px auto;
}

HTML

<div class="grid">
  <div>
    stuff
  </div>
  <div>
    this is a text line
    <pre>
      <code>
        this is a very long text which is used to stress this page and trying to understand why i'm stuck on this problem based on the fact i cannot force overflow text on this basic layout which is supposed to be simple to solve.
      </code>
    </pre>
  </div>
</div>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)