max-width:-webkit-fit-content ie 8 equivalent?

前端 未结 4 522
感动是毒
感动是毒 2021-02-08 18:59

Are there any hacks for max-width:-webkit-fit-content; for ie 8?

Trying to get a child div to not take up the whole width of the parent and this works well

4条回答
  •  心在旅途
    2021-02-08 19:41

    It might depends on the situation:

    I had a block-level element with width: fit-content;. As this doesn't work on IE, the element was taking the full available width (as expected).

    But I wanted it to just adjust its size to its content.

    Finally, i fixed it with:

    display: inline-flex;
    

提交回复
热议问题