简体   繁体   English

带Bootstrap的PrettyPrint无响应

[英]PrettyPrint with Bootstrap is non-responsive

I am using Google's prettyprint with bootstrap to display SQL statements with syntax highlighting. 我正在使用带有引导程序的Google的prettyprint来显示带有语法突出显示的SQL语句。 However, it is not following the responsive features of bootstrap, in the column of 12. It maintains it's own width and height. 但是,它未遵循第12栏中的bootstrap的响应功能。它保持其自身的宽度和高度。 I'm unable to change this using the prettyprint class or the grid system of bootstrap. 我无法使用prettyprint类或bootstrap的网格系统来更改此设置。

  <div class="col-md-12">
    <h4>Query Output</h4>
    <code class="prettyprint">Select name, description From android_db.group Where id=&#39;1&#39;;</code>
  </div>

The reason for this is simple; 这样做的原因是简单的; there is style associated with the code tag; 有与code标签关联的样式; which makes sense if you consider what the code tag does. 如果您考虑code标签的作用,这很有意义。 I would recommend you use the pre tag - that is 我建议您使用pre标签-即

<pre class="prettyprint"></pre>

to avoid it. 避免它。 Also, don't forget to escape < and > with &lt; 另外,不要忘记使用&lt;来转义<> &lt; and &gt; &gt; respectively. 分别。 Or they won't render. 否则它们将无法渲染。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM