如何删除<code> block

时间:2017-08-04 11:56:21

标签: css

I am getting code from server in next format:

<code class="bigCodeBlock">
import std.stdio;
void main() 
{
    writeln("Hello world!");
}
</code>

I can't fix code on server. I need to remove empty line break in result html on top of my code.

My css is next:

.bigCodeBlock
{
    background-color: #F7F4F4;
    display:block;
    white-space: pre-wrap;
}

enter image description here

1 个答案:

答案 0 :(得分:0)

Change your HTML.

<code class="bigCodeBlock">import std.stdio;
void main() 
{
    writeln("Hello world!");
}
</code>

white-space: pre-wrap will preserve whitespace including linebreaks.