<pre> tag

时间:2017-09-02 00:07:41

标签: html css

I have this issue with my pre tag that I have been trying to resolve for a while now. I have tried almost 20 suggestions that I have found and none of them seem to work.

I have a server running with node.js that has 2 websites on it, technically it's one website with 2 layouts. If I try using pre-tag on my 1st layout, everything seems to be displaying normally, however on my 2nd page I guess extra tabs that I can't seem to locate.

Here is what I have:

<pre>&lt;pre&gt;&lt;code &gt;
&lt;script&gt;
    new Chart(document.getElementById(&quot;bar-chart&quot;), {
        type: 'bar',
        data: {
            labels: [&quot;Blue&quot;, &quot;Black&quot;, &quot;Green&quot;, &quot;Silver&quot;, &quot;Red&quot;],
            datasets: [
                {
                    label: &quot;Votes for this color: &quot;,
                    backgroundColor: [&quot;#3e95cd&quot;, &quot;#000000&quot;, &quot;#35d90e&quot;, &quot;#c0c0c0&quot;, &quot;#c45850&quot;],
                    data: [120, 384, 81, 223, 192]
                }
            ]
        },
        options: {
            legend: { display: false },
            title: {
                display: true,
                text: 'Best Car Colors according to a 1000 votes survey'
            }
        }
    });
&lt;/script&gt;
&lt;/code&gt;&lt;/pre&gt;</pre>

and it is displaying like this: Visuals

anyone have any idea what and why? I have tried unsetting all css and re-setting pre tag, but it does exactly the same thing.

1 个答案:

答案 0 :(得分:0)

更新:

对于那些过去和现在仍在努力解决同样问题的人,我发现了这个问题!所以我使用的是把手,其中一个功能被称为“部分”

我有一个页面以这种方式调用那些部分:

{{>crashcorse/intro_lessons}}
然而,在{{&gt;之前}它有一些额外的间隔。标签,由于自动格式化,删除这些额外的间隔似乎解决了这个问题。