HTML5 画布度数符号
对于 HTML5 Canvas 度数符号,请尝试运行以下代码 −
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <style media="screen"> body { margin:5em; background:#eee; text-align:center } canvas { background:#fff; border:2px solid #ccc; display:block; margin:3em auto } </style> </head> <body> <script charset="utf-8"> var c = document.getElementsByTagName('canvas')[0]; c.width = c.height = 300; var context = c.getContext('2d'); context.font = "20px sans-serif"; context.fillText("212° Fahrenheit", 100, 100); </script> </body> </html>
广告