html5+css3怎么才能弄成矩形
答案:2 悬赏:70 手机版
解决时间 2021-11-15 02:37
- 提问者网友:活着好累
- 2021-11-14 06:19
html5+css3怎么才能弄成矩形
最佳答案
- 五星知识达人网友:玩世
- 2019-10-09 21:49
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>锯齿图</title>
<script type="text/javascript">
window.addEventListener("load", eventWindowLoaded, false);
function eventWindowLoaded(){
var x,y;
var theCanvas = document.getElementById("canvas");
var context = theCanvas.getContext("2d");
context.strokeStyle = '#CB9A61';
context.lineWidth=10;
context.strokeRect(10, 10, theCanvas.width-20, theCanvas.height-20);
context.fillStyle = "#FFFFFF";
for(x=5;x<=canvas.width;xx=x+10){
context.beginPath();
context.arc(x,5,5,0,Math.PI*2,true);
context.arc(x,canvas.height-5,5,0,Math.PI*2,true);
context.closePath();
context.fill();
}
for(y=5;y<=canvas.height;yy=y+10){
context.beginPath();
context.arc(5,y,5,0,Math.PI*2,true);
context.arc(canvas.width-5,y,5,0,Math.PI*2,true);
context.closePath();
context.fill();
}
}
</script>
</head>
<body>
<div style="position: absolute; top: 100px; left: 100px;">
<canvas id="canvas" width="400" height="170" top=50px; left=50px;>
</div>
</body>
</html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>锯齿图</title>
<script type="text/javascript">
window.addEventListener("load", eventWindowLoaded, false);
function eventWindowLoaded(){
var x,y;
var theCanvas = document.getElementById("canvas");
var context = theCanvas.getContext("2d");
context.strokeStyle = '#CB9A61';
context.lineWidth=10;
context.strokeRect(10, 10, theCanvas.width-20, theCanvas.height-20);
context.fillStyle = "#FFFFFF";
for(x=5;x<=canvas.width;xx=x+10){
context.beginPath();
context.arc(x,5,5,0,Math.PI*2,true);
context.arc(x,canvas.height-5,5,0,Math.PI*2,true);
context.closePath();
context.fill();
}
for(y=5;y<=canvas.height;yy=y+10){
context.beginPath();
context.arc(5,y,5,0,Math.PI*2,true);
context.arc(canvas.width-5,y,5,0,Math.PI*2,true);
context.closePath();
context.fill();
}
}
</script>
</head>
<body>
<div style="position: absolute; top: 100px; left: 100px;">
<canvas id="canvas" width="400" height="170" top=50px; left=50px;>
</div>
</body>
</html>
全部回答
- 1楼网友:不想翻身的咸鱼
- 2019-10-16 05:25
没法直接看出来,至少得看源文件(一般对网页单击右键就有相应选项,不同浏览器选项不同),分析是否使用了html5新增的标签主要是
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯