使用Bootstrap添加代码框
可先看:简介、引入、包下载等:
Bootstrap 允许您以两种方式显示代码:
标签。如果您想要内联显示代码,那么您应该使用 <code> 标签。
标签。如果代码需要被显示为一个独立的块元素或者代码有多行,那么您应该使用 <pre class="brush:php;toolbar:false;"> 标签。</li><p>请确保当您使用 <pre class="brush:php;toolbar:false;"> 和 <code> 标签时,开始和结束标签使用了 unicode 变体:<strong> <(代表“<”)</strong> 和 <strong>>(代表">")</strong>。</p><p>让我们来看看下面的实例:</p><p class="sycode"> </p><pre class="precsshui"><!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Bootstrap 实例 - 代码</title> <link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet"> <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script> <script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script></head><body><p><code><header></code> 作为内联元素被包围。</p><div class="aritcle_card flexRow">
<div class="artcardd flexRow">
<a class="aritcle_card_img" href="/ai/1284" title="Unreal Images"><img
src="https://img.php.cn/upload/ai_manual/000/000/000/175680129127828.png" alt="Unreal Images" onerror="this.onerror='';this.src='/static/lhimages/moren/morentu.png'" ></a>
<div class="aritcle_card_info flexColumn">
<a href="/ai/1284" title="Unreal Images">Unreal Images</a>
<p>免费的AI图片库</p>
</div>
<a href="/ai/1284" title="Unreal Images" class="aritcle_card_btn flexRow flexcenter"><b></b><span>下载</span> </a>
</div>
</div><p><span>立即学习</span>“<a href="https://pan.quark.cn/s/cb6835dc7db1" style="text-decoration: underline !important; color: blue; font-weight: bolder;" rel="nofollow" target="_blank">前端免费学习笔记(深入)</a>”;</p><p>如果需要把代码显示为一个独立的块元素,请使用 <pre class="brush:php;toolbar:false;"> 标签:</p><pre class="brush:php;toolbar:false;"> <article> <h1>Article Heading</h1> </article>










