内容不适合<pre>

时间:2017-07-30 11:42:52

标签: html css layout

I'm studying a little bit css/html/bootstrap and I was wandering why, in this example, the text inside the <pre> is not wrapped correctly and the horizontal scroll bar is added. Is there a way to remove it and fit all the content in a better way?

Please take a look also to the following image. Thanks and regards

enter image description here

1 个答案:

答案 0 :(得分:2)

pre {
    white-space: pre-wrap;       /* Since CSS 2.1 */
    white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
    white-space: -pre-wrap;      /* Opera 4-6 */
    white-space: -o-pre-wrap;    /* Opera 7 */
    word-wrap: break-word;       /* Internet Explorer 5.5+ */
}