摘要:測試發表程式碼
今天找到一個 .css 在處理程式碼可以出現 scroll box 不知道這個系統可以可以用, 以下是測試結果, 效果還不錯喔 ^_^
效果如下:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
AnsiString as="This is a test source code for testing the web page to showing the source code within a DIV frame box with a horizontal scroll bar for viewing the code...";
}
//---------------------------------------------------------------------------設定方法:自行編輯 .css 加入以下 code
/* Fancy pre code boxes */
.pre {
width: 100%;
padding: 10px 0px 15px;
}
pre {
clear: both;
float: left;
overflow: auto;
_overflow-y: hidden;
background: #f8fbfc;
margin: 0px;
padding: 8px 5px 18px;
min-height: 3em;
width: 95%;
border: 1px solid #bfd0d9;
}
pre, tt, code {
font-family: "Bitstream Vera Sans Mono", Courier New, monospace;
font-size: 1em;
}使用方法:
<DIV=pre><PRE>....code...</PRE></DIV>
不過, 在天空的編輯器會自動把 <ooxx> 視為 HTML TAG
所以, 還需要先把
> 改 &gt;
< 改 &lt;
才行喔。