Button CSS, SVG or Canvas, which format to choose?
Basic examples of creating new form objects for the HTML 5 extension.
To create new form objects, three paths also appear to get an idea of their advantages and disadvantages, comparable to creating a simple customizable button in each format.
CSS button 3
Blue
These buttons are based on standard HTML tags, <button> for the first two, <input> for the latter, and are configured using a stylesheet. HTML tags can be combined to create more complex objects, such as, for example, an abortion list.
These CSS buttons are compatible with modern browsers.
SVG or Canvas objects do not offer this feature, you will have to resort to alternative plugins or frameworks for old browsers.
SVG button
The SVG button allows you to visually detect style effects from software like Inkscape. Unfortunately, the rendering may differ depending on the browsers (the button is ugly under Chrome).
This demonstration is primarily to see how a user can interact with an SVG object. This format allows you to extend HTML 5 with new, more complex objects, allowing you to interact with specific parts of this object. It is enough to associate event handlers with the tag, as you did in this example.
Button Canvas
The third possibility is the use of Canvas. Getting compatible rendering is easier than in SVG, but creating interactive composite objects will be as difficult as creating a game. This format is suitable for creating new objects with little user interaction, such as clocks.
Output: Select the appropriate format for each use
When creating an SVG or Canvas object, it is difficult to write code that is compatible with all browsers, each of which has an interpretation when implementing these formats. Therefore, the main part of the work is to solve compatibility problems, which is a waste of time if you do not find widgets ready for use. It is advisable to use:
Creating HTML and CSS to extend HTML 5 with your objects,
SVG for things like auto-generated and interactive graphics,
Canvas for page-independent graphics or for more complex widgets than just a button, which can include images or animations.