引导<code>

时间:2015-07-26 10:27:40

标签: html css twitter-bootstrap

When trying to show code in <code>, the new lines showed as spaces/tabs.

Here's what I input:

[code]k
i
l
m
[/code]

(Except <> instead of [])

And here's what I get as output:

k i l m

I've tried inserting it with JS using \n, \r, and \r\n.

1 个答案:

答案 0 :(得分:1)

使用<pre>标记代替<code>标记。 另请查看this question/answer