How can I do width = 100% - 100px in CSS?

前端 未结 18 865
借酒劲吻你
借酒劲吻你 2020-12-12 13:28

In CSS, how can I do something like this:

width: 100% - 100px;

I guess this is fairly simple but it is a bit hard to find examples showing

18条回答
  •  萌比男神i
    2020-12-12 14:00

    The short answer is you DON'T do this in CSS. Internet Explorer has support for something called CSS Expressions, but this isn't standard and is definitely not supported by other browsers like FireFox for instance.

    You'd be better off doing this in JavaScript.

提交回复
热议问题