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

前端 未结 18 874
借酒劲吻你
借酒劲吻你 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条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-12 13:55

    You can look into using LESS, which is a JavaScript file that pre-processes your CSS so you can include logic and variables into your CSS. So for your example, in LESS you would write width: 100% - 100px; to achieve exactly what you wanted :)

提交回复
热议问题