Inline span with min-width on IE

后端 未结 3 1698
闹比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:30

    Basing my answer on sandeep's answer, you can use

    span {
        display: inline-block;
        *display: inline;
        *zoom:1;
        width: auto !important;
        width 150px;
        min-width: 150px;
    }
    

    and it should work. Check out this jsfiddle: http://jsfiddle.net/ramsesoriginal/yCvhB/2/

    internet Explorer has some problems with minimum widths and heights, but at the same time it has problems with !important, so exploiting that (and the fact that without specifying overflow every with is a min-width for IE) we can have something working.

提交回复
热议问题