head-img Force's Blog

Less中使用calc()函数编译后错误

CSS

在less中使用calc()计算元素宽度

  #lic-notice {
    width: calc(100% - 200px);
    height: auto;
    z-index: 999;
  }

样式被编译后宽度错误显示width: calc(-100%);

#lic-notice[data-v-49507455] {
    width: calc(-100%);
    height: auto;
    z-index: 999;
}

修正兼容less写法~"xx - xx"

  #lic-notice {
    width: calc(~"100% - 200px");
    height: auto;
    z-index: 999;
  }

ok

点我评论
打赏本文
二维码


125

文章

14

标签

 访客统计  Update-******