js画棋盘
var chess = document.getElementById('chess');
var context = chess.getContext('2d');
context.strokeStyle = "#BFBFBF";
for(var i=0;i<15;i++){
context.moveTo(15+i*30,15);
context.lineTo(15+i*30,435);
context.stroke();
context.moveTo(15,15+i*30);
context.lineTo(435,15+i*30);
context.stroke();
}
var chess = document.getElementById('chess');
var context = chess.getContext('2d');
context.strokeStyle = "#BFBFBF";
for(var i=0;i<15;i++){
context.moveTo(15+i*30,15);
context.lineTo(15+i*30,435);
context.stroke();
context.moveTo(15,15+i*30);
context.lineTo(435,15+i*30);
context.stroke();
}
最新回答 / ICHAYA
我刚开始全部保存 后直接Open in Browser也没有显示保存好所有文件后关掉sublime,直接从文件夹打开HTML文件就有显示了(视频里老师也是从文件夹打开的)后续再次在sublime中Open in Browser 也会有显示浏览器:chrome最新版
2016-03-30
style.css
canvas{
display:block;
margin: 50px auto;
box-shadow: -2px -2px 2px #BFBFBF,5px 5px 5px #B9B9B9;
}
canvas{
display:block;
margin: 50px auto;
box-shadow: -2px -2px 2px #BFBFBF,5px 5px 5px #B9B9B9;
}
2016-03-30