利用 background-size 做视觉差效果
body {
height: 100vh;
width: 100%;
}
#photo {
position: fixed;
top: 0;
left: 0;
z-index: -1;
background: url(b9r5sEL.jpg) no-repeat;
background-size: cover;
height: 100%;
width: 100%;
}
transform-origin()
transform-origin()的默认原点是center,也就是x轴和y轴的50%处。
实例
transform-origin取值为top(或top center或center top或50% 0):
Array.from()
Array.from()方法用于将 类数组对象 和 可遍历对象 转为真正的数组。
类数组对象:本质特征只有一点,既必须有length属性。
可遍历对象:有iterator接口的对象
~~~~
Array.from()一般使用一个参数,即要转化的对象。第二个参数类似数组的map方法
<body>
<div class="qwe">123</div>
<div class="qwe">123</div>
<div class="qwe">123</div>
<script>
let div = document.getElementsByClassName('qwe');
let arr = Array.from(div, x => x.innerHTML + 1 )
console.log(arr)
/*结果(3) ["1231", "1231", "1231"]*/
</script>
</body>