Skip to content

Instantly share code, notes, and snippets.

View pluscai's full-sized avatar
🎯
Focusing

caishuxiang pluscai

🎯
Focusing
View GitHub Profile
@pluscai
pluscai / loop.js
Created October 11, 2019 08:29
JS中的 Duff's Device及其变体
/*
Duff’s device
*/
function loop1() {
var result = [];
function process(value) {
result.push(value*2);
}
var items = [0,1,2,3,4,5,6,7,8];
@pluscai
pluscai / index.html
Last active October 11, 2019 08:30
不定宽高的图片如何在div中水平垂直居中
<h2>不定宽高的图片如何在div中水平垂直居中</h2>
方法1:
<div class="box wraper">
<img src="http://cdn.jsrun.top/css/img/logo.png" alt="" />
</div>
方法2:
<div class="box wraper2">
<img src="http://cdn.jsrun.top/css/img/logo.png" alt="" />
</div>
<h2>多行文本如何在div中水平垂直居中</h2>