Home >Web Front-end >Front-end Q&A >Is canvas a new feature of CSS3?
Canvas is not a new feature of CSS3. Canvas is a new tag of HTML5, which is used to draw graphics through scripts; CSS3 is a language specifically used to control the display effect of web pages, and there is no connection between the two.
The operating environment of this tutorial: Windows 10 system, CSS3&&HTML5 version, Dell G3 computer.
Canvas is not a new feature of css3, but a new tag of html5.
canvas
Note: Any text within the
The example is as follows:
<html> <head> <meta charset="utf-8"> <title>123</title> </head> <body> <canvas id="myCanvas">你的浏览器不支持 HTML5 canvas 标签。</canvas> <script> var c=document.getElementById('myCanvas'); var ctx=c.getContext('2d'); ctx.fillStyle='#FF0000'; ctx.fillRect(0,0,80,100); </script> </body> </html>
Output result:
css3
CSS3 is an upgraded version of CSS (Cascading Style Sheet) technology. It was formulated in 1999. On May 23, 2001, W3C completed the working draft of CSS3, which mainly includes box model, list module, hyperlink method, and language module. , background and border, text effects, multi-column layout and other modules.
One of the major changes in the evolution of CSS is the W3C's decision to break CSS3 into a series of modules. Browser vendors innovate quickly at the pace of CSS, so by taking a modular approach, elements in the CSS3 specification can move forward at different speeds because different browser vendors only support given features. But different browsers support different features at different times, which also complicates cross-browser development.
(Learning video sharing: css video tutorial)
The above is the detailed content of Is canvas a new feature of CSS3?. For more information, please follow other related articles on the PHP Chinese website!