代替 max-content auto 您可以使用 auto 1fr 和 white-space:nowrap 如下:
max-content auto
auto 1fr
white-space:nowrap
dl { display: grid; grid-template-columns: auto 1fr; grid-column-gap: 1em; grid-row-gap: 1em; } dt, dd { margin: 0; padding: 0; } .speaker { white-space:nowrap; } .speaker.stage-director { display: none; } .statement.stage-director { grid-column: span 2; }
<dl> <dt class="speaker">ROMEO</dt> <dd class="statement">What, shall this speech be spoke for our excuse? Or shall we on without a apology?</dd> <dt class="speaker stage-director"></dt> <dd class="statement stage-director">This is a long statement of the stage director</dd> <dt class="speaker">ROMEO</dt> <dd class="statement">Give me a torch: I am not for this ambling; Being but heavy, I will bear the light.</dd> <dt class="speaker">The magic big cat</dt> <dd class="statement">I say nothing</dd> <dt class="speaker">MERCUTIO</dt> <dd class="statement">Nay, gentle Romeo, we must have you dance.</dd> </dl>