bootstrap中使用google prettify讓代碼高亮的方法,bootstrapprettify

來源:互聯網
上載者:User

bootstrap中使用google prettify讓代碼高亮的方法,bootstrapprettify

利用google prettify 讓代碼高亮,好看。

:

 http://code.google.com/p/google-code-prettify/

http://www.bootcdn.cn/prettify/

網路引入地址: //cdn.bootcss.com/prettify/r298/prettify.min.js

如下

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <head> <!-- 新 Bootstrap 核心 CSS 檔案 --> <link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css"> <!-- 可選的Bootstrap主題檔案(一般不用引入) --> <link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap-theme.min.css"> <link href="//cdn.bootcss.com/prettify/r298/prettify.min.css" rel="stylesheet"> <!-- jQuery檔案。務必在bootstrap.min.js 之前引入 --> <script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script> <!-- 最新的 Bootstrap 核心 JavaScript 檔案 --> <script src="//cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> <script src="//cdn.bootcss.com/prettify/r298/prettify.min.js"></script> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>品質錄入</title> </head> <body onload="prettyPrint()"> <form action="<%=basePath %>rest/wx" method="post"> <div class="container"> <h1 class="page-header">代碼<small>google prettify代碼高亮</small></h1> <p>Bootstrap是基於<code>HTML5</code>和<code>CSS3</code>開發的,它在jQuery的基礎上進行了更為個人化和人性化的完善,形成一套自己專屬的網站風格,併兼容大部分jQuery外掛程式。</p> <pre class="prettyprint linenums"> <div class="container"> <h1 class="page-header">列表<small>無序列表、有序列表、描述列表</small></h1> <h2>有序列表</h2> <ul> <li>開發</li> <li>營運</li> <li>需求</li> </ul> <h2>無序列表</h2> <ol> <li>JAVA</li> <li>PHP</li> <li>C#</li> </ol> <h2>描述列表</h2> <dl class="dl-horizontal"> <dt>JAVA</dt><dd>SUN公司的開發語言</dd> <dt>C#</dt><dd>Microsoft公司的語言</dd> </dl> </div> </pre> </div> </form> </body> </html>

以上所述是小編給大家介紹的bootstrap中使用google prettify讓代碼高亮的方法,希望對大家有所協助,如果大家有任何疑問請給我留言,小編會及時回複大家的。在此也非常感謝大家對幫客之家網站的支援!

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.