How to write the code of drawing jagged rectangle with HTML5+CSS3
This article mainly explains the "HTML5+CSS3 draw jagged rectangle code how to write", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in-depth, together to study and learn "HTML5+CSS3 draw jagged rectangle code how to write" it!
We know that canvas can be used to draw graphics, canvas is a new tag that appears in HTML5, which is used to draw graphics on web pages, and canvas of H5 uses Javascript to draw graphics on web pages.
Implementation code:
XML/HTML Code copies content to the clipboard
Sawtooth graph
Window.addEventListener ("load", eventWindowLoaded, false)
Function eventWindowLoaded () {
Var x,y
Var theCanvas = document.getElementById ("canvas")
Var context = theCanvas.getContext ("2d")
Context.strokeStyle ='# CB9A61'
Context.lineWidth=10
Context.strokeRect (10, 10, theCanvas.width-20, theCanvas.height-20)
Context.fillStyle = "# FFFFFF"
For (Xerox)