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;
}
答案 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.