One of the serious issue is web page load time. To do that always we try to make page smaller in size.we know that using image in design is a nightmare. Its always make our page heavy.
To get rid from this hassle CSS gradient feature was introduced by Webkit for about two years but was rarely used due to incompatibility with most browers. But now with the Firefox 3.6+, which supports gradient, we can style create gradient without having to create an image. Here in this post i will show you how to code for the CSS gradient button to be supported by the major browsers: IE, Firefox 3.6+, Safari, and Chrome.
The XHTML is below:
<a href="http://webdeziners.blogspot.com/" class="red">http://webdeziners.blogspot.com/</a>
The css style is below:
.red {
display: inline-block;
outline: none;
cursor: pointer;
text-align: center;
text-decoration: none;
font: 14px/100% Arial, Helvetica, sans-serif;
padding: .5em 2em .55em;
text-shadow: 0 1px 1px rgba(0,0,0,.5);
-webkit-border-radius: .5em;
-moz-border-radius: .5em;
border-radius: .5em;
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.2);
-moz-box-shadow: 0 1px 2px rgba(0,0,0,.2);
box-shadow: 0 1px 2px rgba(0,0,0,.2);
color: #fffbf9;
border: solid 1px #980401;
background: #c50503; /* for non-css3 browsers */
background: -webkit-gradient(linear, left top, left bottom, from(#ff8a50), to(#c30000)); /* For Webkit Browsers */
background: -moz-linear-gradient(top, #ff8a50, #c30000); /* for Firefox */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff8a50', endColorstr='#c30000'); /* for IE */
}
.red:hover {
background: #c50503;
background: -webkit-gradient(linear, left top, left bottom, from(#c30000), to(#ff8a50));
background: -moz-linear-gradient(top, #c30000, #ff8a50);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#c30000', endColorstr='#ff8a50');
}
.red:active {
border: solid 1px #ec3331;
color: #f9baae;
background: -webkit-gradient(linear, left top, left bottom, from(#dc3921), to(#ffb36a));
background: -moz-linear-gradient(top, #dc3921, #ffb36a);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dc3921', endColorstr='#ffb36a');
}
If you use above css and html code the button will be look like following image :
Please note not all browsers support CSS gradient. To be safe, you shouldn’t rely on CSS gradient when coding the layout. It should only be used for enhancing the layout.Hope you enjoy it as much as i do.
To get rid from this hassle CSS gradient feature was introduced by Webkit for about two years but was rarely used due to incompatibility with most browers. But now with the Firefox 3.6+, which supports gradient, we can style create gradient without having to create an image. Here in this post i will show you how to code for the CSS gradient button to be supported by the major browsers: IE, Firefox 3.6+, Safari, and Chrome.
The XHTML is below:
<a href="http://webdeziners.blogspot.com/" class="red">http://webdeziners.blogspot.com/</a>
The css style is below:
.red {
display: inline-block;
outline: none;
cursor: pointer;
text-align: center;
text-decoration: none;
font: 14px/100% Arial, Helvetica, sans-serif;
padding: .5em 2em .55em;
text-shadow: 0 1px 1px rgba(0,0,0,.5);
-webkit-border-radius: .5em;
-moz-border-radius: .5em;
border-radius: .5em;
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.2);
-moz-box-shadow: 0 1px 2px rgba(0,0,0,.2);
box-shadow: 0 1px 2px rgba(0,0,0,.2);
color: #fffbf9;
border: solid 1px #980401;
background: #c50503; /* for non-css3 browsers */
background: -webkit-gradient(linear, left top, left bottom, from(#ff8a50), to(#c30000)); /* For Webkit Browsers */
background: -moz-linear-gradient(top, #ff8a50, #c30000); /* for Firefox */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff8a50', endColorstr='#c30000'); /* for IE */
}
.red:hover {
background: #c50503;
background: -webkit-gradient(linear, left top, left bottom, from(#c30000), to(#ff8a50));
background: -moz-linear-gradient(top, #c30000, #ff8a50);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#c30000', endColorstr='#ff8a50');
}
.red:active {
border: solid 1px #ec3331;
color: #f9baae;
background: -webkit-gradient(linear, left top, left bottom, from(#dc3921), to(#ffb36a));
background: -moz-linear-gradient(top, #dc3921, #ffb36a);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dc3921', endColorstr='#ffb36a');
}
If you use above css and html code the button will be look like following image :
Please note not all browsers support CSS gradient. To be safe, you shouldn’t rely on CSS gradient when coding the layout. It should only be used for enhancing the layout.Hope you enjoy it as much as i do.
nice..but cant we hav two colors in same button that are divided horizontally top color will be different from bottom color...how can we acheive this..plz if anybody is having any idea ..reply(i want this to be done without using images)
ReplyDeletenice info. its really very use help css for all.its good way go get color ful buttons without any image. its also good for seo purpose becouse it reduce the web page weight.
ReplyDeleteThanks for sharing
web Solution Delhi ,Internet Marketing Agency
Very informative tutorial on web design.
ReplyDeleteThanks for sharing.
Really great and awesome post written on web design tricks. Tips included in this post are very helpful for fresh web designer. Thanks for sharing this awesome post.
ReplyDeleteWe web designer always need to keep some point in our mind when designing a webpage.
ReplyDeletecurt
Nike SB Zoom Paul Rodriguez IV High
Very supportive article.I understand every point in this blog about good topic. Singapore SEO Company
ReplyDeletejust linked this article on my facebook account. it’s a very interesting article for all.
ReplyDeleteThanks @webdesign in singapore
ReplyDeleteThank you for a awesome article.You have been shared really an excellent information..
ReplyDeleteGreat thoughts you got there, believe I may possibly try just some of it throughout my daily life...
ReplyDeleteWeb Design Singapore
Hi, probably our entry may be off topic but anyways, I have been surfing around your blog and it looks very professional. It’s obvious you know your topic and you appear fervent about it. I’m developing a fresh blog plus I’m struggling to make it look good, as well as offer the best quality content. I have learned much at your web site and also I anticipate alot more articles and will be coming back soon. Thank you...
ReplyDeleteweb design singapore
I like every post in this blog. Really a nice work has done.
ReplyDeletepimples remedies
this is very nice blog post. the create css gradient button without providing useful information for all thanks.
ReplyDeleteWeb designing course in Chandigarh
Online Javascript Course | Backbone.JS Online Course | KnockoutJS Online Training | Angularjs Online Course | Bootstrap Online Training | Node js Online Course | Typescript Online Training
ReplyDeleteInformative post about CSS gradient buttons.Thanks for share.If you are interested in Web designing then choose web design
ReplyDeletethat provide good it service to you.