100% CSS3 Submit Button - Demo



This demo shows how to create a 100% CSS3 sumbit button as below. The button is fully scalable using the font-size property





The button

        <input type="submit" value="Submit" class="button" />
    

The CSS

        .button
        {
            padding:3px 8px;

            font:bold 1em Arial; color:#ffffff;
            text-shadow: 0px 1px 1px #000000;
            filter: dropshadow(color=#000000, offx=0, offy=1); 

            background: rgb(106,155,203); /* Old browsers */
            background: -moz-linear-gradient(top, rgba(106,155,203,1) 0%, rgba(61,125,188,1) 49%, rgba(47,115,182,1) 50%, rgba(31,105,177,1) 100%); /* FF3.6+ */
            background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(106,155,203,1)), color-stop(49%,rgba(61,125,188,1)), color-stop(50%,rgba(47,115,182,1)), color-stop(100%,rgba(31,105,177,1))); /* Chrome,Safari4+ */
            background: -webkit-linear-gradient(top, rgba(106,155,203,1) 0%,rgba(61,125,188,1) 49%,rgba(47,115,182,1) 50%,rgba(31,105,177,1) 100%); /* Chrome10+,Safari5.1+ */
            background: -o-linear-gradient(top, rgba(106,155,203,1) 0%,rgba(61,125,188,1) 49%,rgba(47,115,182,1) 50%,rgba(31,105,177,1) 100%); /* Opera11.10+ */
            background: -ms-linear-gradient(top, rgba(106,155,203,1) 0%,rgba(61,125,188,1) 49%,rgba(47,115,182,1) 50%,rgba(31,105,177,1) 100%); /* IE10+ */
            filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6a9bcb', endColorstr='#1f69b1',GradientType=0 ); /* IE6-9 */
            background: linear-gradient(top, rgba(106,155,203,1) 0%,rgba(61,125,188,1) 49%,rgba(47,115,182,1) 50%,rgba(31,105,177,1) 100%); /* W3C */

            border:2px solid #cccccc;
            -webkit-border-radius: 5px;
            -moz-border-radius: 5px;
            border-radius: 5px; 
        }
    

Give the button a pressed effect when active

    .button:active
    {
        margin-top:1px;
        
        /* Reversed gradient */
        background: rgb(31,105,177); /* Old browsers */
        background: -moz-linear-gradient(top, rgba(31,105,177,1) 0%, rgba(47,115,182,1) 50%, rgba(61,125,188,1) 51%, rgba(106,155,203,1) 100%); /* FF3.6+ */
        background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(31,105,177,1)), color-stop(50%,rgba(47,115,182,1)), color-stop(51%,rgba(61,125,188,1)), color-stop(100%,rgba(106,155,203,1))); /* Chrome,Safari4+ */
        background: -webkit-linear-gradient(top, rgba(31,105,177,1) 0%,rgba(47,115,182,1) 50%,rgba(61,125,188,1) 51%,rgba(106,155,203,1) 100%); /* Chrome10+,Safari5.1+ */
        background: -o-linear-gradient(top, rgba(31,105,177,1) 0%,rgba(47,115,182,1) 50%,rgba(61,125,188,1) 51%,rgba(106,155,203,1) 100%); /* Opera11.10+ */
        background: -ms-linear-gradient(top, rgba(31,105,177,1) 0%,rgba(47,115,182,1) 50%,rgba(61,125,188,1) 51%,rgba(106,155,203,1) 100%); /* IE10+ */
        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1f69b1', endColorstr='#6a9bcb',GradientType=0 ); /* IE6-9 */
        background: linear-gradient(top, rgba(31,105,177,1) 0%,rgba(47,115,182,1) 50%,rgba(61,125,188,1) 51%,rgba(106,155,203,1) 100%); /* W3C */
    }