摘要: var a = 2.255; var b = a.toFixed(2); console.log(b); 以上代码,按预期正常四舍五入得到结果应该是2.26,但实际返回值为2.25 js浮点数精度作为前端必踩坑,谁也逃不过,不过我们可以改写原型上的方法达到目的 Number.prototype.to 阅读全文
posted @ 2019-11-13 16:23 梁涛999 阅读(492) 评论(0) 推荐(0) 编辑
摘要: 效果: 在线运行 http://oa.hopenchina.com:8086/project/newyear/index.html(建议用手机查看) 知识点: 1、box-sizing:border-box 2、:before 3、first-of-type 4、设置box背景渐变、阴影、边框 ba 阅读全文
posted @ 2019-11-13 10:38 梁涛999 阅读(602) 评论(0) 推荐(0) 编辑