As a web developer and the amount of recent changes to developer and designer techniques and methods, I hope this blog can be helpful to others in the same industry.
Happy reading!
And don't forget to comment if you have an opinion on what I've posted.

BlueFlux Graphic Design

My Home

Friday, 6 April 2012

Drawing A Button HTML5 and CSS3 - No Images Used

Save on download times for your websites and blogs.

Below is a relatively tidy button rendered through your browser using only HTML (no images).If you consider how many buttons and menus you may need to use for your web page, it can all add up to a lot of bandwidth savings.

This button has been drawn using the HTML5 gradient fill method. Unfortunately, there seems to be no support as yet, for rounding corners of the canvas.So, I have used another div and applied an inset box-shadow to make it look like the corners are rounded.However, there is some support for rounding the canvas corners when using the SVG gradient method.This will be my next post.

For a more detailed look go to http://www.blueflux.eu/HTML5.html

This post was written as all the new methods were being released. Since then I have cleaned up the html to make it easier for anyone reading this to understand, and copy and paste the code into their own HTML editor to experiment with themselves.There is also more support for CSS3 in most of the modern browsers available.Instead of using the HTML5 Gradient, you can use CSS to do it instead, below is an example of a gradient fill:( Support for this technique is still limited for example on IE9 and Opera and using HTML5 instead seems to have more support within all the browsers rather than using css. )

This will apply a gradient from one colour to another, starting at the top, and will be blended in half way down the height of the div( or canvas ) to the second colour:#FFFFFF.

***This is supported in all but Internet Explorer 9 and below and a few mobile browsers like Dolphin HD for Android.***There is now greater support for the border-radius property:border-radius:1em;/2px;But again, support isn't 100% so you'll have to do the same as me and many other developers and make up your own mind on how to design your site and the best techniques to use to cover the wide variety of browsers that people use today.