Inline span with min-width on IE

后端 未结 3 1705
闹比i
闹比i 2021-02-13 11:41

Hi
I have 3 SPAN that must be inline and have and a min-width.
Apparently on IE, the SPAN can\'t have an min-wi

3条回答
  •  天涯浪人
    2021-02-13 12:25

    inline element can't take width, height, vertical margin & padding. So you have to define display:inline-block; write like this:

    span {
        display: inline-block;
        *display: inline;/* for IE7*/
        *zoom:1;/* for IE7*/
        min-width: 150px;
    }
    

    Source: Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification: 10.3 Calculating widths and margins: 10.3.1 Inline, non-replaced elements:

    The 'width' property does not apply. A computed value of 'auto' for 'margin-left' or 'margin-right' becomes a used value of '0'.

    check this http://jsfiddle.net/yCvhB/5/

提交回复
热议问题