I'm a beginner in HTML. I'm having problem in how to syntax my html doc. If I indent the second line inside the <pre>
element, the pre formatted text doesn't appear correctly in the browser.
<body>
<dl>
<dt>thing 1</dt>
<dd>Description text</dd>
<dd><blockquote>
<pre>Pre formated text first line.
Pre formatted text second line</pre>
</blockquote></dd>
</dl>
</body>
but if I want the text to appear correctly in the browser, my document becomes a mess.
<body>
<dl>
<dt>thing 1</dt>
<dd>Description text</dd>
<dd><blockquote>
<pre>Pre formated text first line.
Pre formatted text second line</pre>
</blockquote></dd>
</dl>
</body>
How to syntax the <pre>
element correctly?
答案 0 :(得分:0)
试试这个
<body>
<dl>
<dt>thing 1</dt>
<dd>Description text</dd>
<dd><blockquote>
<pre>
Pre formated text first line.<br>
Pre formatted text second line
</pre>
</blockquote></dd>
</dl>
添加CSS
pre {
white-space: normal;
}