CSS Button has a border

前端 未结 7 466
旧巷少年郎
旧巷少年郎 2021-01-23 21:58

I am trying to define a custom css button for my search form. I cant figure out why this particular button has a strange border around it? I need to get it removed but cannot

7条回答
  •  猫巷女王i
    2021-01-23 22:25

    You are applying the CSS to the spans inside the button, so the default styling for the button is still being used:

    Get rid of all the messy , and, as @Christoph said in the comments, type="submit" can be omitted, as it is the default functionality of a button:

     
    

    Apply the CSS to the input:

    button.button-search::-moz-focus-inner { padding:0; border:0; } /* FF Fix */
    button.button-search { -webkit-border-fit:lines; } /* <- Safari & Google Chrome Fix */
    button.button-search { position:absolute; right:10px; top:8px; } 
    button.button-search { 
        background: #3399CC; /* Old browsers */
        box-shadow:1px 1px 0 #a4a4a4; 
        display:block;
        float:none;
        width:88px; 
        height:32px; 
        line-height:30px; 
        text-align:center; 
        font-size:15px; 
        color:#fff;
        text-align:center !important;
        border:none;/*Removes the border*/
    }
    

    http://jsfiddle.net/q3t2srfg/1/

提交回复
热议问题