一段html5 画布 显示文字效果的代码 帮忙查下错谢谢
代码显示不出效果<html><head></head><body><canvasid="mc"width="600"height="280"style="border:1...
代码显示不出效果
<html>
<head>
</head>
<body>
<canvas id="mc" width="600" height="280"
style="border:1px solid black"></canvas>
<script type="text/javascript">
var canvas = document.getElementById('mc');
var ctx=canvas.getContext('2d');
ctx.fillStyle='#00f';
ctx.font = 'italic 50px 隶书';
ctx.textBaseline = 'top';
//填充字符串
ctx.fillText('疯狂Java讲义',0,0);
ctx.strokeStyle='#f0f';
ctx.font = 'bold 45px 宋体';
//绘制字符串的边框
ctx.strokeText('轻量级 Java EE 企业应用实战‘,0,50);
</script>
</body>
</html> 展开
<html>
<head>
</head>
<body>
<canvas id="mc" width="600" height="280"
style="border:1px solid black"></canvas>
<script type="text/javascript">
var canvas = document.getElementById('mc');
var ctx=canvas.getContext('2d');
ctx.fillStyle='#00f';
ctx.font = 'italic 50px 隶书';
ctx.textBaseline = 'top';
//填充字符串
ctx.fillText('疯狂Java讲义',0,0);
ctx.strokeStyle='#f0f';
ctx.font = 'bold 45px 宋体';
//绘制字符串的边框
ctx.strokeText('轻量级 Java EE 企业应用实战‘,0,50);
</script>
</body>
</html> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询