Persistent margin and 1px height difference around input elements

后端 未结 5 1371
广开言路
广开言路 2021-02-20 06:03

I\'m having a problem with input elements:

\"problematic

Even though in that picture their

5条回答
  •  你的背包
    2021-02-20 06:17

    Try this one: demo fiddle.

    HTML:

    
    

    CSS:

    span, input {
        margin: 0;
        padding: 0;
    }
    span {
        display: inline-block;
        border: 1px solid black;
        height: 25px;
        overflow: hidden;
    }
    input {
        border: none;
        height: 100%;
    }
    input[type="submit"] {
        border-left: 1px solid black;
    }
    

    Tested on Win7 in IE8, IE9, Opera 11.50, Safari 5.0.5, FF 5.0, Chrome 12.0. Only IE7 fails since it obstinately shows a normal button-like submit input.

提交回复
热议问题