I do have a container which is displayed as grid with three children; one left (.25fr), one middle (1fr), one right (.25fr). As soon as I insert a <code>
tag within the mid child which does have lots of whitespaces the entire layout is broken.
I've also tried to give the pre
and/or code
max widths / overflows, but nothing fixed it.
Anyone got an idea?
.test {
width: 600px;
background-color: #cacaca;
display: grid;
grid-template-columns: 0.25fr 1fr 0.25fr;
margin-bottom: 50px;
}
.left {
background-color: green;
}
.right {
background-color: red;
}
<div class="test">
<div class="left">
left
</div>
<div class="mid">
<pre>
<code> ff</code>
</pre>
</div>
<div class="right">
right
</div>
</div>
<div class="test">
<div class="left">left</div>
<div class="mid">mid</div>
<div class="right">right</div>
</div>