Link with image inside - html

I am struggling with image inside a link. I don't know hot to make the first link (with image) be the same size as other links in paginations. I also don't know how to align them ?
.content .pagination a {
text-decoration: none;
color: #717171;
border: 1px solid #c0c0c0;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
padding: 3px 8px;
margin: 0 1px;
background-color: #fff;
background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#ededed));
background-image: -webkit-linear-gradient(top, #fff, #ededed);
background-image: -moz-linear-gradient(top, #fff, #ededed);
background-image: -ms-linear-gradient(top, #fff, #ededed);
background-image: -o-linear-gradient(top, #fff, #ededed);
background-image: linear-gradient(top, #fff, #ededed);
}
.content .pagination a.prev {
padding: 11px;
position: relative;
vertical-align: middle;
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAICAYAAADaxo44AAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAB4SURBVHjaYvj//z8DDBcWFqYBcTuIzQgiQKCoqCgNSM1kgAArsASyYEhICIMVEDB/+vTJDMjfiCSYBWSuZ7KxsdGFamd49OjRMiA1HcQGGWV5DAjWrFkDk0/v6+ubBbM8Eyg3DUnSnAHJuSDJ/1u2bAEy/5sBBBgAv6VOHKw5pxYAAAAASUVORK5CYII=) 8px 7px no-repeat;
border: 1px solid #d9d9d9;
line-height: 0;
font-size: 0;
color: transparent;
}
HTML code:
<div class="pagination">
‹
1</div>

Are you talking about this ? :
<img src="path">
<img src="path">
</div>

May be the easier way to get that is to use an unicode character
CSS
.pagination a {
text-decoration: none;
color: #717171;
border: 1px solid #c0c0c0;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
width: 18px;
padding: 3px 8px;
margin: 0 1px;
background-color: #fff;
background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#ededed));
background-image: -webkit-linear-gradient(top, #fff, #ededed);
background-image: -moz-linear-gradient(top, #fff, #ededed);
background-image: -ms-linear-gradient(top, #fff, #ededed);
background-image: -o-linear-gradient(top, #fff, #ededed);
background-image: linear-gradient(top, #fff, #ededed);
}
.pagination a.prev:before {
content: "\03c";
}
fiddle
If you are interested in this technique, shapecatcher can be a valuable resource

Related

Issues implementing a custom button https://cssbuttoncreator.com/ into my basic site

I have been trying with no success to add a custom button, you create in this site. I have made sure my class is called the same thing in html as the code in css that has been provided BUT nothing happens. I have tried deleting all the different webkits and building it out line by line. The strange thing is when I can get it to work it basically creates the button I do want but with portions of the box on different lines.
.button {
background: #11CDD4;
background-image: -webkit-linear-gradient(top, #11CDD4, #11999E);
background-image: -moz-linear-gradient(top, #11CDD4, #11999E);
background-image: -ms-linear-gradient(top, #11CDD4, #11999E);
background-image: -o-linear-gradient(top, #11CDD4, #11999E);
background-image: linear-gradient(to bottom, #11CDD4, #11999E);
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-radius: 8px;
color: #FFFFFF;
font-family: Arial;
font-size: 40px;
font-weight: 100;
padding: 40px;
box-shadow: 1px 1px 20px 0px #000000;
-webkit-box-shadow: 1px 1px 20px 0px #000000;
-moz-box-shadow: 1px 1px 20px 0px #000000;
text-shadow: 1px 1px 20px #000000;
border: solid #337FED 1px;
text-decoration: none;
display: inline-block;
cursor: pointer;
text-align: center;
}
.button:hover {
border: solid #337FED 1px;
background: #30ECDB;
background-image: -webkit-linear-gradient(top, #30ECDB, #2BC4AD);
background-image: -moz-linear-gradient(top, #30ECDB, #2BC4AD);
background-image: -ms-linear-gradient(top, #30ECDB, #2BC4AD);
background-image: -o-linear-gradient(top, #30ECDB, #2BC4AD);
background-image: linear-gradient(to bottom, #30ECDB, #2BC4AD);
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 20px;
text-decoration: none;
}
<div class="contact-me">
<h2>Get In Touch</h2>
<h3>If you are interested in collaborating on a project</h3>
<p class="contact-me-skill"> To be updated.</p>
<a class="button" href="mailto:myemail#gmail.com">Contact Me</button>
</div>
</div>
I built cssbuttoncreator.com. Thank you for using my app.
Your issues are as follows:
You don't have a closing tag, instead you have placed a closing tag.
There's an extra closing tag when there's just one div in the code.

What is wrong with my layout? Fixed Header with iframe

I am trying to make a iframe for website demos so I want to add a fixed header. Why does my right Buy Now Button will keep getting lower then it should? I have tried a few things but I am not a coder.
Here is my code:
#headerfix {
height: 60px;
background-color:#000;
border-bottom: 2px solid gold;
z-index: 99999;
position: fixed;
width: 100%;
}
.button {
border: 2px solid gold;
background: #ff9900;
background: -webkit-gradient(linear, left top, left bottom, from(#ffff00), to(#ff9900));
background: -webkit-linear-gradient(top, #ffff00, #ff9900);
background: -moz-linear-gradient(top, #ffff00, #ff9900);
background: -ms-linear-gradient(top, #ffff00, #ff9900);
background: -o-linear-gradient(top, #ffff00, #ff9900);
background-image: -ms-linear-gradient(top, #ffff00 0%, #ff9900 100%);
padding: 7.5px 15px;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
-webkit-box-shadow: rgba(255,255,255,0.4) 0 1px 0, inset rgba(255,255,255,0.4) 0 1px 0;
-moz-box-shadow: rgba(255,255,255,0.4) 0 1px 0, inset rgba(255,255,255,0.4) 0 1px 0;
box-shadow: rgba(255,255,255,0.4) 0 1px 0, inset rgba(255,255,255,0.4) 0 1px 0;
text-shadow: #303030 0 1px 0;
color: #000000;
font-size: 18px;
font-family: helvetica, serif;
text-decoration: none;
vertical-align: middle;
}
.button:hover {
border: 2px solid #d9ff00;
text-shadow: #1e4158 0 1px 0;
background: #ffff00;
background: -webkit-gradient(linear, left top, left bottom, from(#ff9900), to(#ffff00));
background: -webkit-linear-gradient(top, #ff9900, #ffff00);
background: -moz-linear-gradient(top, #ff9900, #ffff00);
background: -ms-linear-gradient(top, #ff9900, #ffff00);
background: -o-linear-gradient(top, #ff9900, #ffff00);
background-image: -ms-linear-gradient(top, #ff9900 0%, #ffff00 100%);
color: #fff;
}
.button:active {
text-shadow: #1e4158 0 1px 0;
border: 2px solid #d9ff00;
background: #ff9900;
background: -webkit-gradient(linear, left top, left bottom, from(#ffff00), to(#ffff00));
background: -webkit-linear-gradient(top, #ffff00, #ff9900);
background: -moz-linear-gradient(top, #ffff00, #ff9900);
background: -ms-linear-gradient(top, #ffff00, #ff9900);
background: -o-linear-gradient(top, #ffff00, #ff9900);
background-image: -ms-linear-gradient(top, #ffff00 0%, #ff9900 100%);
color: #000000;
}
#preview-frame {
margin: 0 auto;
display: block;
padding-top: 60px;
width:100%;
height: 581px;
}
<div id="headerfix">
<section style="width:15%; float:left;"><img style='padding-left: 10px; padding-top: 2.5px;' src="https://turnkey-shop.com/wp-content/uploads/2017/11/demo-tunkey-icon.png" alt="Turnkey-Shop.com"></section>
<section style='padding-left:15%; padding-top:8px; width:70%; text-align:center; float:none; font-size:25px; color:gold;'>Product Name</section>
<section style='padding-left:15%; width:70%; text-align:center; float:none; font-size:12px; color:gold;'>SKU</section>
<section style='padding-left:85%; width: 15%; float:none; '><a href='https://turnkey-shop.com/' class='button'>Buy Now</a></section>
</div>
<iframe id="preview-frame" src="https://turnkey-shop.com/" frameborder="0"></iframe>
I want my button to be center in the top bar.
Use margin-top property in the section to properly align your button
Fiddle: http://jsfiddle.net/sanchitpatiyal95/QQKc4/184/

CSS3 create this button using only single DIV

I am trying to create a button similar to this in CSS3. (all HTML5 browsers should be supported):
Button image
HTML:
<div class="buttonClass">Nitin Mukesh</div>
CSS:
body {
background: gray;
margin-top: 50px;
margin-left: 50px;
}
.buttonClass {
width: 300px;
height: 40px;
padding: 10px 60px;
-webkit-border-radius: 7px;
-moz-border-radius: 7px;
border-radius: 7px;
background: -moz-linear-gradient(top, #FFFFFF 0%, #91BDD6 100%); /* firefox */
border: solid #91BDD6 5px;
outline: solid #fff 5px;
-moz-box-shadow: 3px 1px 24px #000000;
-webkit-box-shadow: 3px 1px 24px #000000;
box-shadow: 3px 1px 24px #000000;
}
JSFiddle
I could possible think of a solution that using 2 div will solve the problem with outer div hold the white outline and box-shadow and inner div with outline and gradient color.
Is it possible to achieve this using single div.
Many thanks for any inputs
This is what I came up with: http://jsfiddle.net/psycketom/heGu9/2/
.button
{
display: block;
background-image: linear-gradient(bottom, rgb(145,189,214) 0%, rgb(255,255,255) 100%);
background-image: -o-linear-gradient(bottom, rgb(145,189,214) 0%, rgb(255,255,255) 100%);
background-image: -moz-linear-gradient(bottom, rgb(145,189,214) 0%, rgb(255,255,255) 100%);
background-image: -webkit-linear-gradient(bottom, rgb(145,189,214) 0%, rgb(255,255,255) 100%);
background-image: -ms-linear-gradient(bottom, rgb(145,189,214) 0%, rgb(255,255,255) 100%);
background-image: -webkit-gradient(
linear,
left bottom,
left top,
color-stop(0, rgb(145,189,214)),
color-stop(1, rgb(255,255,255))
);
/* Added second shadow for that "black" effect */
box-shadow: 0px 0px 0px 5px white, 0px 0px 10px 5px black;
-o-box-shadow: 0px 0px 0px 5px white, 0px 0px 10px 5px black;
-ms-box-shadow: 0px 0px 0px 5px white, 0px 0px 10px 5px black;
-moz-box-shadow: 0px 0px 0px 5px white, 0px 0px 10px 5px black;
-webkit-box-shadow: 0px 0px 0px 5px white, 0px 0px 10px 5px black;
border-radius: 15px;
-o-border-radius: 15px;
-ms-border-radius: 15px;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border: solid 5px rgb(145,189,214);
padding: 60px;
margin: 7px; /* to complement the outside shadow */
}
box-shadow can have multiple shadow, so:
http://jsfiddle.net/cyzw8/4/
.buttonClass {
width: 200px;
height: 40px;
/* padding: 10px 60px;*/
text-align:center;
line-height:40px;
border-radius: 7px;
background-image:-webkit-linear-gradient(top,#FFF 0%,#91BDD6 100%);
background-image: -moz-linear-gradient(top, #FFFFFF 0%, #91BDD6 100%);
background-image:-ms-linear-gradient(top,#FFF,#91BDD6);
background-image:-o-linear-gradient(top,#FFF,#91BDD6);
background-image:linear-gradient(top,#FFF,#91BDD6);
border: solid #91BDD6 5px;
box-shadow: 0px 0px 0px 5px #fff, 5px 3px 12px #000000;
}
This is what I see in my Chrome:
Here is a second way http://jsfiddle.net/Merec/Va4qG/
<div class="buttonClass"><span>Nitin Mukesh</span></div>
.buttonClass {
display: inline-block;
background: #fff;
border: 2px solid #fff;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
background: rgb(255,255,255); /* Old browsers */
background: -moz-linear-gradient(top, rgba(255,255,255,1) 0%, rgba(145,189,214,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,1)), color-stop(100%,rgba(145,189,214,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(145,189,214,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(145,189,214,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(145,189,214,1) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(255,255,255,1) 0%,rgba(145,189,214,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#91bdd6',GradientType=0 ); /* IE6-9 */
}
.buttonClass span {
padding: 5px 10px;
display: block;
border: 2px solid #91bdd6;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}

Is it possible to perfectly replicate this in css3?

The div: sidebar-top at http://alex.piechowski.org/school/...
CSS:
.sidebar-top {
float: left;
height: 32px;
width: 292px;
background: url(../images/sidebar_top.png) no-repeat;
padding: 4px 15px;
}
Note, it's an image. Is it possible without that image?
You can achieve a fairly similar effect with these rules:
border-top-right-radius: 12px;
border-top-left-radius: 12px;
border: 1px solid #ccc;
width: 290px;
background: -webkit-linear-gradient(top, white 0%,#ddd 100%);
background: linear-gradient(to bottom, white 0%,#ddd 100%);
I think this DEMO is what you need
.sidebar-top {
background: #ccc;
border: 1px solid rgba(0,0,0,0.5);
border-radius: 6px;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
box-shadow: inset 0 -20px 40px #aaa, inset 0 20px 40px #fff, 0 2px 6px rgba(0,0,0,0.5);
-o-box-shadow: inset 0 -20px 40px #aaa, inset 0 20px 40px #fff, 0 2px 6px rgba(0,0,0,0.5);
-webkit-box-shadow: inset 0 -20px 40px #aaa, inset 0 20px 40px #fff, 0 2px 6px rgba(0,0,0,0.5);
-moz-box-shadow: inset 0 -20px 40px #aaa, inset 0 20px 40px #fff, 0 2px 6px rgba(0,0,0,0.5);
padding: 0px 20px 15px 10px;
width: 500px;
}
h2 {
text-align: center;
font-family: "Helvetica Neue", sans-serif;
color: #444;
text-shadow: 0 1px 1px #fff;
font-size: 14px;
margin: -0 -20px 10px -10px;
padding: 5px 15px;
border-radius: 5px 5px 0 0;
-webkit-border-radius: 5px 5px 0 0;
-moz-border-radius: 5px 5px 0 0;
background: rgba(0,0,0,0.2);
border-bottom: 2px groove rgba(255,255,255,0.75);
box-shadow: inset 0 1px 1px rgba(255,255,255,0.5);
-o-box-shadow: inset 0 1px 1px rgba(255,255,255,0.5);
-webkit-box-shadow: inset 0 1px 1px rgba(255,255,255,0.5);
-moz-box-shadow: inset 0 1px 1px rgba(255,255,255,0.5);
}
Absolutely.
you'll need to set a background-color then you can do a border to get the 1px border and border-radius that just encompasses the top corners, sort of like this:
background-color: grey;
border: 1px solid black;
border-radius: 5px 5px 0 0;
To get the gradient, you can set up a box-shadow using the inset to get the desired gradient, or as another answer suggests, use a linear-gradient.
.sidebar-top {
float: left;
height: 38px;
width: 292px;
-webkit-border-top-left-radius: 15px;
-webkit-border-top-right-radius: 15px;
-moz-border-radius-topleft: 15px;
-moz-border-radius-topright: 15px;
border-top-left-radius: 15px;
border-top-right-radius: 15px;
border:1px solid #D3D3D3;
background-color:#FBFBFB;
background-image: -ms-linear-gradient(top, #FBFBFB 0%, #EAEFEF 100%);
background-image: -moz-linear-gradient(top, #FBFBFB 0%, #EAEFEF 100%);
background-image: -o-linear-gradient(top, #FBFBFB 0%, #EAEFEF 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #FBFBFB), color-stop(1, #EAEFEF));
background-image: -webkit-linear-gradient(top, #FBFBFB 0%, #EAEFEF 100%);
background-image: linear-gradient(to bottom, #FBFBFB 0%, #EAEFEF 100%);
}
.sidebar-top h2 {
color: #666666;
font: bold 16px Arial,Helvetica,sans-serif;
letter-spacing: -1px;
margin: 10px;
padding:0px;
text-transform: capitalize;
}
Yes it is, you can use the below mentioned css
from here you can generate css based gradient effects
http://www.colorzilla.com/gradient-editor/
.sidebar-top {
background: rgb(254,255,255); /* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZlZmZmZiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjM1JSIgc3RvcC1jb2xvcj0iI2Y3ZjdmNyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNlZWVlZWUiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
background: -moz-linear-gradient(top, rgba(254,255,255,1) 0%, rgba(247,247,247,1) 35%, rgba(238,238,238,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(254,255,255,1)), color-stop(35%,rgba(247,247,247,1)), color-stop(100%,rgba(238,238,238,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(254,255,255,1) 0%,rgba(247,247,247,1) 35%,rgba(238,238,238,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(254,255,255,1) 0%,rgba(247,247,247,1) 35%,rgba(238,238,238,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(254,255,255,1) 0%,rgba(247,247,247,1) 35%,rgba(238,238,238,1) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(254,255,255,1) 0%,rgba(247,247,247,1) 35%,rgba(238,238,238,1) 100%); /* W3C */
border: 1px solid #d3d3d3;
border-radius: 10px 10px 0 0;
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#feffff', endColorstr='#eeeeee',GradientType=0 ); /* IE6-8 */
float: left;
height: 32px;
padding: 4px 15px;
width: 292px;
}

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/