如何获得< pre style ="溢出:滚动;高度:150像素">显示在特定的滚动行? [英] How do I get <pre style="overflow: scroll; height : 150px" > to display at particular scroll line?

查看:32
本文介绍了如何获得< pre style ="溢出:滚动;高度:150像素">显示在特定的滚动行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要前面显示的代码部分指向特定的行号.如果之前有100行,我希望在150px框的中心显示第51行.

I need for the code section shown in pre to point to a particular line number. If there are 100 lines in pre I want what is shown to be line 51 for right in the center of the 150px box.

推荐答案

尝试一下(10行):

<pre style="width: 300px; height: 10pc; overflow-y: scroll;">
  1
  2
  3
  4
  5
  6
  7
  8
  9
  10
  11
  12
</pre>

注意"pc"而不是"px"

Note "pc" instead "px"

这篇关于如何获得&lt; pre style =&quot;溢出:滚动;高度:150像素"&gt;显示在特定的滚动行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆