フロー内容が期待される場所。
どちらのタグも省略不可。
構造が要素によってではなく印刷規則によって表される、整形済みテキストのブロックを表す。
HTML 構文において、PRE 要素の開始タグの直後にある冒頭の改行文字は取り除かれる。
PRE 要素を使用できるケースの一部の例:
コンピューター コードのブロックを表すために、PRE 要素は、CODE 要素とともに使用できる。
コンピューター出力のブロックを表すために、PRE 要素は、SAMP 要素とともに使用できる。
同様に、KBD 要素は、ユーザーが入力するテキストを示すために、PRE 要素内で使用できる。
次の断片において、コンピューター コードのサンプルが提示される。
<P>This is the <CODE>Panel</CODE> constructor:</P> <PRE><CODE>function Panel(element, canClose, closeHandler) { this.element = element; this.canClose = canClose; this.closeHandler = function () { if (closeHandler) closeHandler() }; }</CODE></PRE>
表示結果:
This is the Panel
constructor:
function Panel(element, canClose, closeHandler) {
this.element = element;
this.canClose = canClose;
this.closeHandler = function () { if (closeHandler) closeHandler() };
}
次の断片において、SAMP と KBD 要素は、『ゾークⅠ』のセッションを表示するために、PRE 要素の内容で混合される。
<PRE><SAMP>You are in an open field west of a big white house with a boarded front door. There is a small mailbox here. </SAMP> <KBD>open mailbox</KBD> <SAMP>Opening the mailbox reveals: A leaflet. </SAMP> </PRE>
<PRE> ABCabc.[*]/\漢字 <MARK>テスト</MARK>です </PRE>
表示内容: |
表示内容: |