The problem here is that you’re using an image that already has this zebra effect. To use background images in this way, which in the background are small strips that repeat horizontally, then the image cannot have anything white.
To use sprites then your original image must have the two entire images, I don’t see how to have two strips/lines with space between them in the same image and repeat only the part you are looking for. Then they would have to be there as @bfavareto suggests, one on top of the other.
An image/Sprite with the full button would look like this (single image/file):
and in the CSS:
background-image:url('http://i.stack.imgur.com/Zi14e.jpg');
background-position:-5px 0px;
and the other part of the image
background-image:url('http://i.stack.imgur.com/Zi14e.jpg');
background-position:-115px 0px;
You can also use CSS only, for example use this tool to choose colors and click you can see the CSS.
Only with CSS will your image need:
gradient: to have different color at the top and bottom
border-Radius: to make the corners round
.botao {
margin-top: 40px;
border-top: 1px solid #000000;
background: #000000;
background: -webkit-gradient(linear, left top, left bottom, from(#777), to(#000000));
background: -webkit-linear-gradient(top, #777, #000000);
background: -moz-linear-gradient(top, #777, #000000);
background: -ms-linear-gradient(top, #777, #000000);
background: -o-linear-gradient(top, #777, #000000);
padding: 13px 26px;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
-webkit-box-shadow: rgba(0, 0, 0, 1) 0 1px 0;
-moz-box-shadow: rgba(0, 0, 0, 1) 0 1px 0;
box-shadow: rgba(0, 0, 0, 1) 0 1px 0;
text-shadow: rgba(0, 0, 0, .4) 0 1px 0;
color: white;
font-size: 19px;
font-family:'Lucida Grande', Helvetica, Arial, Sans-Serif;
text-decoration: none;
vertical-align: middle;
}
.botao:hover {
border-top-color: #28597a;
background: #0422ba;
background: -webkit-gradient(linear, left top, left bottom, from(#27274f), to(#0422ba));
background: -webkit-linear-gradient(top, #27274f, #0422ba);
background: -moz-linear-gradient(top, #27274f, #0422ba);
background: -ms-linear-gradient(top, #27274f, #0422ba);
background: -o-linear-gradient(top, #27274f, #0422ba);
color: #ccc;
}
Alexandre, consider putting your code on http://www.jsfiddle.net/, it’s hard to help you with just these images.
– Caio Tarifa
Friend above has an EXAMPLE link. Read my question and look for the name Example with a link.
– Alexandre Lopes
http://jsfiddle.net/59YSK/
– Alexandre Lopes