<style>
.edit {
width: 300px;
height: 200px;
padding: 5px;
border: solid 1px #ccc;
resize: both;
overflow: auto;
}
</style>
<body>
<div class="edit" contenteditable="true">
这里是可以编辑的内容,配合容器的 overflow ,多行截断,自定义滚动条,简直好用的不要不要的。
</div>
</body>
<div class="container">
<section class="left red"></section>
<section class="middle blue"></section>
<section class="right red"></section>
</div>
.container {
width: 100%;
height: 100%;
display: flex;
}
.left,.right {
flex: 0 0 auto;
width: 50px;
height: 100%;
}
.middle {
flex: 1 1 auto;
height: 100%;
}
.red {
background-color: red;
}
.blue {
background-color: blue;
}
原因: .
发生了歧义,它既可以理解为小数点,也可以理解为对方法的调用。因为这个点紧跟于一个数字之后,按照规范,解释器就把它判断为一个小数点
解决:
(10).toFixed(10)
10..toFixed(10)
10 .toFixed(10)
10.0.toFixed(10)
原文:https://www.cnblogs.com/EricZLin/p/12210282.html