Home >Web Front-end >Front-end Q&A >Is canvas a new feature of CSS3?

Is canvas a new feature of CSS3?

WBOY
WBOYOriginal
2022-03-30 14:32:422004browse

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.

Is canvas a new feature of CSS3?

The operating environment of this tutorial: Windows 10 system, CSS3&&HTML5 version, Dell G3 computer.

Is canvas a new feature of css3?

Canvas is not a new feature of css3, but a new tag of html5.

canvas

tag uses scripts (usually JavaScript) to draw graphics (such as charts and other images).

tags are just graphics containers, you have to use a script to draw the graphics.

Note: Any text within the element will be displayed in browsers that do not support .

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(&#39;myCanvas&#39;);
var ctx=c.getContext(&#39;2d&#39;);
ctx.fillStyle=&#39;#FF0000&#39;;
ctx.fillRect(0,0,80,100);
</script>
</body>
</html>

Output result:

Is canvas a new feature of CSS3?

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn