I’m working on a button with a glossy appearance. The button can have various colors and sizes. This is what i have done so far:
.btn-zen-inverse, .btn-zen-inverse:hover{
color: white;
background:
url("../img/btn_right.png") no-repeat right 0,
url("../img/btn_left.png") no-repeat left 0,
url("../img/btn_center.png") repeat-x 42px 0;
background-color: #273032;
background-size: contain;
line-height: 50px;
margin: 12px 18px 3px 0;
padding: 0;
border: 2px solid white !important;
}
The images referenced are alpha transparent. The idea is to set the color based on the background-color attribute. The image has a few other properties aswell, but those are merely estetic.
This ofcorse renders an image that looks like this!
I would like the center-image to be visible only in the central part of the image. As you can see from my css. This only has to work perectly in the latest version of the big 4 browsers.

This is what I would like it to look like:

One suggesion is to do this with background-gradients. If that is possible, I need to define the background position similairly to the way padding/margin works. Is that possible?
The design contains:
2 borders:
one white
one gradiented,
A background gradient.
and a 1px thick vertical gradient at the very top.
This is as closer as i can get with CSS only.
Note that multiple backgrounds are not supported by IE8. Neither is the following code, but at least you don’t need images.
Live demo
HTML:
CSS:
There are 2 classes (
.buttonfor the layout and.darkfor colors and gradient) so that you can have different types of buttons in your page.