What Is The
Có thể bạn quan tâm
The HTML 5 <canvas> tag is an HTML element that creates a blank drawing area where graphics can be rendered on web pages. The <canvas> element supports both 2D and 3D graphics. This depends on the context it is used. It supports 2D graphics through the 2D context and 3D graphics through the WebGLWeb Graphics Library context.
The <canvas> element isn’t restricted to still graphics. It also supports animations. This means it can be used to build games, interactive web applications, visualize data, manipulate photos and perform real-time video processing.
The <canvas> element is used extensively for graphics on the web. Web applications like Figma, Draw.io, and Canva also use the <canvas> element.
Code
To create a new canvas, add a <canvas> element to an HTML document. This creates a 300x150 px blank canvas.
OutputHTMLRunTo see the canvas in action, use the JavaScript canvas API to draw an orange rectangle.
OutputJavaScriptHTMLRunRepresentation of drawn rectangle on canvasRelevant Answers
Explore Courses
License: Creative Commons-Attribution-ShareAlike 4.0 (CC-BY-SA 4.0)Learn in-demand tech skills in half the time
PRODUCTSMock Interview
NewCourses
Skill Paths
Projects
Assessments
TRENDING TOPICSLearn to Code
Tech Interview Prep
Generative AI
Data Science
Machine Learning
GitHub Students Scholarship
Early Access Courses
Blind 75
PricingFor Individuals
Try for Free
Gift a Subscription
CONTRIBUTEBecome an Author
Become an Affiliate
Earn Referral Credits
RESOURCESBlog
Cheatsheets
Webinars
Answers
ABOUT USOur Team
Careers
HiringFrequently Asked Questions
Contact Us
Press
LEGALPrivacy Policy
Cookie Policy
Terms of Service
Business Terms of Service
Data Processing Agreement
INTERVIEW PREP COURSESGrokking the Modern System Design Interview
Grokking the Product Architecture Design Interview
Grokking the Coding Interview Patterns
Machine Learning System Design
Tiktok Streamline Icon: https://streamlinehq.comCopyright ©2024 Educative, Inc. All rights reserved.
Từ khóa » Html Canvas
-
HTML Canvas Graphics - W3Schools
-
HTML Canvas Tutorial - W3Schools
-
Canvas API - MDN Web Docs
-
Canvas Tutorial - Web APIs | MDN
-
HTML Canvas - Javatpoint
-
HTML5 - Canvas - Tutorialspoint
-
25 Ridiculously Impressive HTML5 Canvas Experiments
-
How To Draw Graphics On HTML5 Canvas - Tutorial Republic
-
HTML5 Canvas Tutorial For Beginners | An Intro To Becoming A Pro
-
A Full Overview Of HTML Canvas - FreeCodeCamp
-
HTML
-
JavaScript Canvas