Intentando replicar este botón CSS3

Trying to solve the first question posted here: http://css-tricks.com/interview-questions-css/?utm_source=buffer&utm_campaign=Buffer&utm_content=bufferb57be&utm_medium=facebook

My rough attempt: http://jsfiddle.net/Mbg82/1/

<span class="buttonContainer">
    <span class="button">
        <span class="star">&#9733;</span> 
        Checkout
        <span class="star">&#9733;</span> 
    </span>
</span>
<style>
    .buttonContainer {
    background-color: #ccc;
    border-radius: 20px;
    border: 3px solid #fff;
    padding: 5px;
    margin: 10px 30px;
    display: inline-block;
    box-shadow: -0px 0px 1px 1px #000;
}

.button {
    background-color: #eee;
    border-radius: 10px;
    border: 1px solid #777;
    padding: 10px;
    margin: 5px;
    display: inline-block;
    text-transform: uppercase;
    font: bold 26px   "arial";
    color: #555;
    background-image: -moz-linear-gradient(bottom, #aaa 10%, #eee 90%);
}

.star {
    font-size: 32px;
    color: #777;        
}
</style>

I couldn't get the glossy effect on the button itself - can you help me?

preguntado el 27 de noviembre de 13 a las 06:11

From the link that you provide: How did they split the background in the main part of the button? a linear-gradient with no fade would be a good technique there. Or box-shadow. -

3 Respuestas

mira este enlace http://jsfiddle.net/modaloda/Mbg82/2/

yo suelo http://www.colorzilla.com/gradient-editor/ to get the glossy effect

background: #ffffff; /* Old browsers */
background: -moz-linear-gradient(top,  #ffffff 0%, #d1d1d1 50%, #bcbcbc 51%, #f6f6f6   100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(50%,#d1d1d1), color-stop(51%,#bcbcbc), color-stop(100%,#f6f6f6)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top,  #ffffff 0%,#d1d1d1 50%,#bcbcbc 51%,#f6f6f6 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top,  #ffffff 0%,#d1d1d1 50%,#bcbcbc 51%,#f6f6f6 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top,  #ffffff 0%,#d1d1d1 50%,#bcbcbc 51%,#f6f6f6 100%); /* IE10+ */
background: linear-gradient(to bottom,  #ffffff 0%,#d1d1d1 50%,#bcbcbc 51%,#f6f6f6 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#f6f6f6',GradientType=0 ); /* IE6-9 */

respondido 27 nov., 13:07

Creo que el repetición de fondo property will do it for you. You can choose an background image and repeat it on horizontal.

respondido 27 nov., 13:07

in button class you have added the

`background-image: -webkit-linear-gradient(bottom, #aaa 10%, #eee 90%);`

en lugar de #eee Solo usa #fffor some lighter color

respondido 27 nov., 13:07

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.