Transparent Buttons using ImageButton Class asp - html

Okay here is the style sheet code: I want the ButtonTrans.png to be across each button on top auto fitting the size of the button.
.ButtonPanel {
position: absolute;
top: 0px;
left: 770px;
width: 500px;
height: 44px;
font-size: 12px;
font-weight: bold;
margin: 0px !important;
padding: 0px !important;
}
.functionbutton {
padding: 8px 4px;
margin: 6px 6px;
background: #3292aa;
background: -webkit-linear-gradient(top, #3292aa 0, #017795 100%);
background: linear-gradient(to bottom, #3292aa 0, #017795 100%);
border-color: #017795;
box-shadow: none;
color: #fff;
border-radius: 7px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 12px;
cursor: pointer;
}
.functionbutton:hover {
background: #33a3c0 !important;
background: -webkit-linear-gradient(top, #33a3c0 0, #038eb2 100%) !important;
background: linear-gradient(to bottom, #33a3c0 0, #038eb2 100%) !important;
box-shadow: none !important;
border-color: #038eb2 !important;
}
.toolbutton {
padding: 8px 4px;
margin: 6px 6px;
background: #f8f8f8;
background: -webkit-linear-gradient(top, #f8f8f8 0, #f2f2f2 100%);
background: linear-gradient(to bottom, #f8f8f8 0, #f2f2f2 100%);
border-color: #ccc;
box-shadow: 0 1px 0 0 #fff inset;
outline: 0;
border: 1px solid #ccc;
text-decoration: none;
border-radius: 7px;
text-decoration: none;
display: inline-block;
font-size: 12px;
cursor: pointer;
}
.toolbutton:hover {
background: #fdfdfd !important;
background: -webkit-linear-gradient(top, #fdfdfd 0, #fafafa 100%) !important;
background: linear-gradient(to bottom, #fdfdfd 0, #fafafa 100%) !important;
border-width: 1px !important;
border-style: solid !important;
}
And here is the HTML for the actual buttons within the page. I want the ButtonTrans.png to be the same size as each button and reside directly on top of the button to give the effect the button was clicked. I can not change any of the server side code currently so this will have to be the fix for now. I have attached a image of what I am looking for. I picture i have attached has style="postions:absolute;height:30px;width100px:" values added.
and idea of what I am trying to do
<asp:Panel ID="ButttonPanel" runat="server" CssClass="ButtonPanel">
<div class="toolbutton">
<label id="FlatPDFLbl">PDF</label>
<asp:ImageButton ID="FlatPDFBtn" runat="server" runat="server" ImageUrl='<%# "App_Themes/" + Session["Theme"] + "/Images/ButtonTrans.png"%>' ToolTip="Create Flat PDF from Template" TabIndex="-1" OnClick="FlatPDFBtn_Click"></asp:ImageButton>
</div>
<div class="toolbutton">
<label id="FullPDFLbl">Fillable PDF</label>
<asp:ImageButton ID="FullPDFBtn" runat="server" runat="server" ImageUrl='<%# "App_Themes/" + Session["Theme"] + "/Images/ButtonTrans.png"%>' ToolTip="Create Fillable PDF from Template" TabIndex="-1"
OnClick="FullPDFBtn_Click"></asp:ImageButton>
</div>
<div class="functionbutton">
<label id="SaveLbl">Save</label>
<asp:ImageButton ID="SaveBtn" CssClass="SaveBtn" runat="server" commandname="Launch" ImageUrl='<%# "App_Themes/" + Session["Theme"] + "/Images/ButtonTrans.png"%>' ToolTip="Save changes to this customer" TabIndex="-1" OnClick="SaveBtn_Click"></asp:ImageButton>
</div>
</asp:Panel>

Related

Use DIV Containers as Flat Buttons with images inside

I want to create a button bar on top of the page, with div containers that contain images to use them as flat button. My problem is that I cannot get the alignment correctly.
Is there an additional way to highlight the last clicked button, so that you can see which button on the buttonbar is active without using javascript?
Here is my first approach:
<html>
<head>
<title>
</title>
<style>
#top {
position: fixed;
background-color: #AAA;
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(transparent));
background-image: -webkit-linear-gradient(top, #fff, transparent);
background-image: -moz-linear-gradient(top, #fff, transparent);
background-image: -o-linear-gradient(top, #fff, transparent);
background-image: linear-gradient(to bottom, #fff, transparent);
left: 0px;
top: 0px;
width: 100%;
height: 60px;
padding: 0px;
border: thin solid rgba(0,0,0,0.6);
color: #444444;
font-family: Droid sans, Arial, Helvetica, sans-serif;
font-size: 12px;
cursor: pointer;
-webkit-box-shadow: rgba(0,0,0,0.5) 3px 3px 10px;
-moz-box-shadow: rgba(0,0,0,0.5) 3px 3px 10px;
box-shadow: rgba(0,0,0,0.5) 3px 3px 10px;
}
.flatBtn2 {
height: 50px;
width: 50px;
margin-left: 5px;
margin-top: 5px;
float: left;
display: inline;
}
.flatBtn2:hover {
background-color: #eee;
height: 50px;
width: 50px;
margin-left: 5px;
margin-top: 5px;
float: left;
display: inline;
}
.buttonBar {
float:left;
}
</style>
</head>
<body>
<div id="top">
<div id="selectReiter" style="display:inline" class="buttonBar">
<div id="firstButton" class="flatBtn2" />
<div id="secondButton" class="flatBtn2" />
<div id="thirdButton" class="flatBtn2" />
</div>
</div>
</body>
</html>
#top {
position: fixed;
background-color: #AAA;
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(transparent));
background-image: -webkit-linear-gradient(top, #fff, transparent);
background-image: -moz-linear-gradient(top, #fff, transparent);
background-image: -o-linear-gradient(top, #fff, transparent);
background-image: linear-gradient(to bottom, #fff, transparent);
left: 0px;
top: 0px;
width: 100%;
height: 60px;
padding: 0px;
border: thin solid rgba(0, 0, 0, 0.6);
color: #444444;
font-family: Droid sans, Arial, Helvetica, sans-serif;
font-size: 12px;
cursor: pointer;
-webkit-box-shadow: rgba(0, 0, 0, 0.5) 3px 3px 10px;
-moz-box-shadow: rgba(0, 0, 0, 0.5) 3px 3px 10px;
box-shadow: rgba(0, 0, 0, 0.5) 3px 3px 10px;
}
.flatBtn2 {
height: 50px;
width: 50px;
margin-left: 5px;
margin-top: 5px;
float: left;
display: inline;
background-color: transparent;
border: none;
}
.flatBtn2:hover {
background-color: #eee;
height: 50px;
width: 50px;
margin-left: 5px;
margin-top: 5px;
float: left;
display: inline;
}
.flatBtn2:focus {
background-color: #eee;
}
.buttonBar {
float: left;
}
<div id="top">
<div id="selectReiter" style="display:inline" class="buttonBar">
<button id="firstButton" class="flatBtn2" >Button 1</button>
<button id="secondButton" class="flatBtn2" >Button 2</button>
<a id="thirdButton" href="#" class="flatBtn2">A 3</a>
</div>
</div>
First of all if you want to use button, then you should you the <button> tag and add the background image through css. You can also manipulate the states in css, what you are seacrhing for is :focus and :active, so you have two rules for your buttons. The normal button rule with the main background-image and an other rule button:focus, button:active where you can load an other image or do something else.
See fiddle for a working example. I added the needed styles at the end of your css.
Hope this helps!

CSS Precedence Issue

I have in my style.css the rule which applies to entire web site:
a:hover{text-decoration:underline;color:#E35B00;}
I have also in my button.css:
.button {
display: inline-block;
zoom: 1; /* zoom and *display = ie7 hack for display:inline-block */
*display: inline;
vertical-align: baseline;
margin: 0 2px;
outline: none;
cursor: pointer;
text-align: center;
text-decoration: none;
font: 14px/100% Arial, Helvetica, sans-serif;
font-weight:bold;
padding: .5em 1.5em .55em;
text-shadow: 0 1px 1px rgba(0,0,0,.3);
-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);
}
.button:hover {
text-decoration: none;
}
.button:active {
position: relative;
top: 1px;
}
.green {
color: #e8f0de;
border: solid 1px #538312;
background: #64991e;
background: -webkit-gradient(linear, left top, left bottom, from(#7db72f), to(#4e7d0e));
background: -moz-linear-gradient(top, #7db72f, #4e7d0e);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#7db72f', endColorstr='#4e7d0e');
}
.green:hover {
background: #538018;
background: -webkit-gradient(linear, left top, left bottom, from(#6b9d28), to(#436b0c));
background: -moz-linear-gradient(top, #6b9d28, #436b0c);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#6b9d28', endColorstr='#436b0c');
}
.green:active {
color: #a9c08c;
background: -webkit-gradient(linear, left top, left bottom, from(#4e7d0e), to(#7db72f));
background: -moz-linear-gradient(top, #4e7d0e, #7db72f);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#4e7d0e', endColorstr='#7db72f');
}
In my html page I have declared style.css before the button.css:
<link href="/css/style.css" media="screen" rel="stylesheet" type="text/css" />
<link href="/css/button.css" media="screen" rel="stylesheet" type="text/css" />
The code is:
<div>
<form action="dosomething.htm" method="post">
<input type="submit" class="button blue" value="Option 1">
Option 2
</form>
</div>
The blue button (Option 1) has no problem with hovering because it is not an anchor. However the green button (Option 2) when hover over "Option 2" it is turning to the color of a:hover which is #E35B00 orange color instead of #538018; green color!
On the Firefox developer Rules console I am seeing the a:hover is below the green:hover. Why is this the case? I tried rearranging the order of the css but it's no use. The a:hover takes over the green:hover. This is driving me nuts. Your help is appreciated. Thanks in advance.
You never specify what color you want the text to be when you hover on the .green button, so it defaults to a:hover. To fix this, you just have to add in the color of what the .green button to the CSS .green:hover rule.
The whole .green:hover CSS rule should look like this.
.green:hover {
color: #e8f0de;
background: #538018;
background: -webkit-gradient(linear, left top, left bottom, from(#6b9d28), to(#436b0c));
background: -moz-linear-gradient(top, #6b9d28, #436b0c);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#6b9d28', endColorstr='#436b0c');
}
a:hover {
text-decoration: underline;
color: #E35B00;
}
.button {
display: inline-block;
zoom: 1;
/* zoom and *display = ie7 hack for display:inline-block */
*display: inline;
vertical-align: baseline;
margin: 0 2px;
outline: none;
cursor: pointer;
text-align: center;
text-decoration: none;
font: 14px/100% Arial, Helvetica, sans-serif;
font-weight: bold;
padding: .5em 1.5em .55em;
text-shadow: 0 1px 1px rgba(0, 0, 0, .3);
-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);
}
.button:hover {
text-decoration: none;
}
.button:active {
position: relative;
top: 1px;
}
.green {
color: #e8f0de;
border: solid 1px #538312;
background: #64991e;
background: -webkit-gradient(linear, left top, left bottom, from(#7db72f), to(#4e7d0e));
background: -moz-linear-gradient(top, #7db72f, #4e7d0e);
filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#7db72f', endColorstr='#4e7d0e');
}
.green:hover {
color: #e8f0de;
background: #538018;
background: -webkit-gradient(linear, left top, left bottom, from(#6b9d28), to(#436b0c));
background: -moz-linear-gradient(top, #6b9d28, #436b0c);
filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#6b9d28', endColorstr='#436b0c');
}
.green:active {
color: #a9c08c;
background: -webkit-gradient(linear, left top, left bottom, from(#4e7d0e), to(#7db72f));
background: -moz-linear-gradient(top, #4e7d0e, #7db72f);
filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#4e7d0e', endColorstr='#7db72f');
}
<div>
<form action="dosomething.htm" method="post">
<input type="submit" class="button blue" value="Option 1" />
Option 2
</form>
</div>
Another option is to put !important after color: #e8f0de in the .green CSS rule. !important makes a property take precedence no matter what.
If you want to do this, then the first line of the .green rule should be.
color: #e8f0de !important;
a:hover {
text-decoration: underline;
color: #E35B00;
}
.button {
display: inline-block;
zoom: 1;
/* zoom and *display = ie7 hack for display:inline-block */
*display: inline;
vertical-align: baseline;
margin: 0 2px;
outline: none;
cursor: pointer;
text-align: center;
text-decoration: none;
font: 14px/100% Arial, Helvetica, sans-serif;
font-weight: bold;
padding: .5em 1.5em .55em;
text-shadow: 0 1px 1px rgba(0, 0, 0, .3);
-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);
}
.button:hover {
text-decoration: none;
}
.button:active {
position: relative;
top: 1px;
}
.green {
color: #e8f0de !important;
border: solid 1px #538312;
background: #64991e;
background: -webkit-gradient(linear, left top, left bottom, from(#7db72f), to(#4e7d0e));
background: -moz-linear-gradient(top, #7db72f, #4e7d0e);
filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#7db72f', endColorstr='#4e7d0e');
}
.green:hover {
background: #538018;
background: -webkit-gradient(linear, left top, left bottom, from(#6b9d28), to(#436b0c));
background: -moz-linear-gradient(top, #6b9d28, #436b0c);
filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#6b9d28', endColorstr='#436b0c');
}
.green:active {
color: #a9c08c;
background: -webkit-gradient(linear, left top, left bottom, from(#4e7d0e), to(#7db72f));
background: -moz-linear-gradient(top, #4e7d0e, #7db72f);
filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#4e7d0e', endColorstr='#7db72f');
}
<div>
<form action="dosomething.htm" method="post">
<input type="submit" class="button blue" value="Option 1" />
Option 2
</form>
</div>

remove blue glow from a submit button

I already tried several solutions found online on this website and many others but nothing solved the problem. I tried
Outline:0;, Outline:none;, box-shadow:none;, tried specifying a class etc. etc.
I created my own stylish button and the blue glow being put around it looks very ugly.
It's also important I can remove it, as I'm creating a multi-page form (survey) with 3 buttons below each page, I don't want one of them to have a blue outline. They should all look the same.
I can't provide a links since I work offline.
This is my code:
a.button,
input[type='reset'],
input[type='button'],
input[type='submit'],
input[type='submit']:focus
{
-moz-border-radius: 2px;
-moz-box-shadow: 1px 1px 2px 2px rgba(255, 255, 255, 0.1);
-webkit-box-shadow: 1px 1px 2px 2px rgba(255, 255, 255, 0.1);
-webkit-border-radius: 2px;
background-color: #f9f9f9; /* Alabaster */
background-image: -webkit-gradient(linear, left top, left bottom, from(#f9f9f9), to(#f1f1f1));
background-image: -webkit-linear-gradient(top, #f9f9f9, #f1f1f1);
background-image: -moz-linear-gradient(top, #f9f9f9, #f1f1f1);
background-image: -ms-linear-gradient(top, #f9f9f9, #f1f1f1);
background-image: -o-linear-gradient(top, #f9f9f9, #f1f1f1);
background-image: linear-gradient(top, #f9f9f9, #f1f1f1);
box-shadow: 1px 1px 2px 0px rgba(226, 226, 226, 0.8);
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-o-border-radius: 5px;
border: 1px solid #dddddd;
color: #000000;
cursor: pointer;
display: inline-block;
min-width: 100px;
width: 120px;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#f9f9f9, endColorstr=#f1f1f1);
font-size: 14px;
font-weight: 700;
line-height: 20px;
margin: 0;
padding: 4px 0px;
text-decoration: none;
vertical-align: middle;
white-space: nowrap;
outline:transparent;
}
<span style="float:left;">
<span style="direction:rtl;float:left;margin-right:10px;">
<input type="submit" name="_NNext" class="mrNext" style="width: 70px;" value="Volgende" alt="Volgende"></input>
<input type="submit" name="_NPrev" class="mrPrev" style="width: 70px;" value="Vorige" alt="Vorige"></input>
</span>
<input type="submit" name="_NStop" class="mrStop" style="width: 70px;" value="Stop" alt="Stop"></input>
</span>

Hovering on <li> on menu item causes expantion by 1px

I am creating a menu which I am trying to base on this menu:
http://www.yootheme.com/widgetkit
However I have run into a small problem where if you hover over the middle of the menu item, it works ok, but if you hover over the edge of it (where the border line is), it moves itself and the other menu items in front of it to the right by 1px.
I have been messing around with the code for a fair amount of time now and can't seem to figure it out.
HTML:
<div class="nav">
<ul>
<li>Home</li>
<li class="active">Structure</li>
<li>Buttons</li>
<li>Forms</li>
<li>Download</li>
</ul>
</div>
CSS:
.nav {
max-width: 100%;
}
.nav ul {
max-width: 100%;
margin: 0 auto;
background: #FFFFFF;
background: -webkit-linear-gradient(top, #FFFFFF 1%, #F5F6F6 100%);
background: -moz-linear-gradient(top, #FFFFFF 1%, #F5F6F6 100%);
background: -ms-linear-gradient(top, #FFFFFF 1%, #F5F6F6 100%);
background: -o-linear-gradient(top, #FFFFFF 1%, #F5F6F6 100%);
background: linear-gradient(top, #FFFFFF 1%, #F5F6F6 100%);
background-attachment: scroll;
background-clip: border-box;
background-origin: padding-box;
background-position: 0 0;
background-repeat: repeat-x;
background-size: 100% 100%;
border: 1px solid #c8c9ca;
border-radius: 6px 6px 6px 6px;
height: 40px;
}
.nav ul li {
margin-top: -1px;
padding-top: 1px;
float: left;
height: 39px;
list-style: none outside none;
}
.nav ul li:first-child {
border-left: none;
}
.nav ul li.active{
border-left: 1px solid #DCDDDE;
border-right: 1px solid #DCDDDE;
padding-top: 1px;
float: left;
list-style: none outside none;
background: -webkit-linear-gradient(center top , #F7F8F9 0%, #FBFCFD 15%, #FEFEFE 100%);
background: -moz-linear-gradient(center top , #F7F8F9 0%, #FBFCFD 15%, #FEFEFE 100%);
background: -ms-linear-gradient(center top , #F7F8F9 0%, #FBFCFD 15%, #FEFEFE 100%);
background: -o-linear-gradient(center top , #F7F8F9 0%, #FBFCFD 15%, #FEFEFE 100%);
background: linear-gradient(center top , #F7F8F9 0%, #FBFCFD 15%, #FEFEFE 100%);
border-left: 1px solid #DCDDDE;
border-top: 1px solid #D2D3D4;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) inset;
color: #000000;
}
.nav ul li.active:hover{
padding-left: 1px;
padding-right: 1px;
}
.nav ul li:hover{
border-right: 1px solid #DCDDDE;
border-left: 1px solid #DCDDDE;
border-top: 1px solid #D2D3D4;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07) inset;
color: #000000;
}
.nav ul li a {
float: left;
text-decoration: none;
display: block;
font-family: 'YanoneKaffeesatzLight', Arial, sans-serif;
height: 38px;
line-height: 38px;
padding-left: 22px;
padding-right: 22px;
display: block;
color: #444444;
font-size: 17px;
text-shadow: 0 1px 0 #FFFFFF;
}
.nav ul li a:hover{
padding-left: 21px;
padding-right: 21px;
}
I have also made a JSFiddle for a proper preview.
Can anyone help me figure out why this is happening and provide a possible solution? It's probably something stupid I'm not seeing.
That's because you put borders on LI:HOVER and after that you change the padding on A:HOVER not on LI:HOVER again. Just change the place of :hover like this:
.nav ul li:hover a{
padding-left: 21px;
padding-right: 21px;
}
And I think it should be fine now.

How to make button-looking buttons that are not images in form-submit buttons?

I had a designer help me make links that look like buttons that look something like this: http://www.comehike.com/hikes/scheduled_hike.php?hike_id=233 (the yellow buttons are the RSVP, Ride, Drive, etc.)
Those are not images. They are just styled links.
My question is - can I make a similar type of non-image button for the buttons that are submit buttons in forms?
Thanks!
Submit button with hover effect.
<!doctype html>
<head>
<style>
.button{
-moz-border-radius:6px;
-webkit-border-radius:6px;
border-radius: 6x;
border: 1px solid #ABABAB;
background-image: -webkit-gradient(linear, left top, left bottom, from(#E1E1E1), to(#F7F7F7));
background-image: -webkit-linear-gradient(top, #E1E1E1, #F7F7F7);
background-image: -moz-linear-gradient(top, #E1E1E1, #F7F7F7);
background-image: -ms-linear-gradient(top, #E1E1E1, #F7F7F7);
background-image: -o-linear-gradient(top, #E1E1E1, #F7F7F7);
background-image: linear-gradient(top, #E1E1E1, #F7F7F7);
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#E1E1E1', EndColorStr='#F7F7F7');
padding: 15px 0px;
margin: 0 auto;
width: 224px;
display: block;
color: #434953;
text-transform: uppercase;
font: 182% "League Gothic", Helvetica, Arial, sans-serif;
text-decoration:none;
text-align:center;
}
.button:hover{
border: 1px solid #ABABAB;
color: #303030;
background-image: -webkit-gradient(linear, left top, left bottom, from(#F7F7F7), to(#E1E1E1));
background-image: -webkit-linear-gradient(top, #F7F7F7, #E1E1E1);
background-image: -moz-linear-gradient(top, #F7F7F7, #E1E1E1);
background-image: -ms-linear-gradient(top, #F7F7F7, #E1E1E1);
background-image: -o-linear-gradient(top, #F7F7F7, #E1E1E1);
background-image: linear-gradient(top, #F7F7F7, #E1E1E1);
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#F7F7F7', EndColorStr='#E1E1E1');
-webkit-box-shadow: 0px 0px 5px rgba(0,0,0,0.10) inset;
-moz-box-shadow: 0px 0px 5px rgba(0,0,0,0.10) inset;
box-shadow: 0px 0px 5px rgba(0,0,0,0.10) inset;
}
</style>
</head>
<body>
<input type="submit" class="button" value="submit" />
</body>
Yes, you can style the default buttons anyway you like, here is some CSS to get you started:
HTML
Gray Button
Red Button
Green Button
<button>Normal Button</button>
<button class="btn green">Green Button</button>
<button class="btn red">Red Button</button>
<button class="btn gray">Gray Button</button>
CSS
a, button {
display:list-item;
margin:10px 0;
}
a.button, button.btn {
color: #6e6e6e;
font: bold 12px Helvetica, Arial, sans-serif;
text-decoration: none;
padding: 7px 12px;
position: relative;
display: inline-block;
background: #f3f3f3;
background: -webkit-gradient(linear,0% 40%,0% 70%,from(#F5F5F5),to(#F1F1F1));
background: -moz-linear-gradient(linear,0% 40%,0% 70%,from(#F5F5F5),to(#F1F1F1));
border: solid 1px #dcdcdc;
border-radius: 2px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
margin-right: 10px;
}
a.red, button.red {
color:#fff;
background: red;
background: -webkit-gradient(linear,0% 40%,0% 70%,from(#FF0000),to(#F1F1F1));
background: -moz-linear-gradient(linear,0% 40%,0% 70%,from(#FF0000),to(#F1F1F1));
}
a.green, button.green {
background: #7FFF24;
background: -webkit-gradient(linear,0% 40%,0% 70%,from(#7FFF24),to(#F1F1F1));
background: -moz-linear-gradient(linear,0% 40%,0% 70%,from(#7FFF24),to(#F1F1F1));
}
Demo link: http://jsfiddle.net/andresilich/cXv8A/1/