CSS “overflow” culls “background-color”

后端 未结 5 1159
再見小時候
再見小時候 2021-02-02 09:21

I\'m trying to style blocks of code for a website. The container div is set to overflow both vertically and horizontally. The problem is when it overflows horizontally, the zebr

5条回答
  •  独厮守ぢ
    2021-02-02 10:08

    Lines are expanding like every block element to the maximum width - and that is without overflow. And they are not connected - if one is bigger, it does not affect others.

    Try changing them to something else than block element, like that:

    .codeblock pre code .line {
        display: table-row;
    }
    

    Table-related types change width or height (cells) together

    http://jsfiddle.net/D7rND/

提交回复
热议问题