Setting a length (height or width) for one element minus the variable length of another, i.e. calc(x - y), where y is unknown

后端 未结 6 2306
忘了有多久
忘了有多久 2020-11-28 12:50

I know we can use calc when lengths are defined:

flex-basis: calc(33.33% - 60px);
left: calc(50% - 25px);
height: calc(100em/5);

But what i

6条回答
  •  鱼传尺愫
    2020-11-28 13:08

    In both cases on container css you should put:

    #container {
        overflow: hidden;
    }
    

    But, it will hide the information that overflows the container. I think that is the point, since you put white-space: nowrap; it means that you don't want to change the height, so you have to hide the text that can't fits the container.

提交回复
热议问题