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

前端 未结 18 844
借酒劲吻你
借酒劲吻你 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 14:04

    You can try this...

    
    width: calc(100% - 100px);
    
    width: calc(100vh - 100px);

    vw: viewport width

    vh: viewport height

提交回复
热议问题