Home  >  Article  >  Web Front-end  >  HTML5 how to draw a rectangle with color and transparency for shape diagram_html5 tutorial tips

HTML5 how to draw a rectangle with color and transparency for shape diagram_html5 tutorial tips

WBOY
WBOYOriginal
2016-05-16 15:47:312000browse
1. Customize brush style

If you want to add color to the shape map, you need to use the following two important attributes.

fillStyle: Set the default color for all fill operations.
strokeStyle: Set the default color for all stroke operations.

2. Draw a rectangle with color and transparency

Copy code
The code is as follows:





HTML5





Tip: Your browser The device does not support the tag




3. Drawing effect
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