Programing

IE7은 디스플레이를 이해하지 못합니다 : 인라인 블록

lottogame 2020. 7. 3. 18:40
반응형

IE7은 디스플레이를 이해하지 못합니다 : 인라인 블록


누군가이 버그를 해결하는 데 도움을 줄 수 있습니까? Firefox에서는 잘 작동하지만 Internet Explorer 7에서는 그렇지 않습니다. 를 이해하지 못하는 것 같습니다 display: inline-block;.

html :

<div class="frame-header">
    <h2>...</h2>
</div>

CSS :

.frame-header {
    height:25px;
    display:inline-block;   
}

IE7 display: inline-block;핵은 다음과 같습니다.

display: inline-block;
*display: inline;
zoom: 1;

기본적으로 IE7은 inline-block자연 inline요소 ( Quirksmode Compatibility Table ) 만 지원 하므로 다른 요소에 대해서는이 핵만 필요합니다.

zoom: 1트리거에이 hasLayout행동, 우리는 사용 성급 숙박 시설은 해킹을 설정에 displayinline(그것을 적용되지 않습니다 새로운 브라우저) IE7 낮은로만. hasLayoutinline함께 기본적으로 트리거 inline-block우리는 행복하다, 그래서 IE7에서 작동합니다.

이 CSS는 유효성을 검사하지 않으며 어쨌든 스타일 시트를 엉망으로 만들 수 있으므로 조건부 주석을 통해 IE7 전용 스타일 시트를 사용하는 것이 좋습니다.

<!–-[if IE 7]>
<link rel="stylesheet" href="ie7.css" type="text/css" />
<![endif]–->

최신 정보

아무도 IE6과 7을 더 이상 사용 하지 않기 때문에 다른 해결책을 제시 할 것입니다.
더 이상 해킹이 필요하지 않습니다. IE8 이 자체적으로 지원 하기 때문에 더 이상 해킹이 필요하지 않습니다.

IE8 이전의 석기 브라우저를 지원 해야하는 사람들을 위해 (IE8이 너무 오래되어 기침 이 아니라는 것은 아닙니다 )
IE 버전 제어를 위해 그의 기사 에서 Paul Irish States <html>와 같은 태그의 일부 조건부 클래스를 사용 하십시오

<!--[if IE 7]><html class="no-js lt-ie9 lt-ie8"><![endif]-->
<!--[if IE 8]><html class="no-js lt-ie9"><![endif]-->
<!--[if gt IE 8]><!--><html class="no-js"><!--<![endif]-->

이것에 의해 당신은 다른 IE 브라우저를 위해 html-tag에 다른 클래스를 갖게 될 것입니다

필요한 CSS는 다음과 같습니다

.inline-block {
    display: inline-block;
}
.lt-ie8 .inline-block {
    display: inline;
    zoom: 1;
}

이것은 유효하며 추가 CSS 파일이 필요하지 않습니다.


이전 답변

.frame-header
{
    background:url(images/tab-green.png) repeat-x left top;
    height:25px;
    display:-moz-inline-box;    /* FF2 */
    display:inline-block;   /* will also trigger hasLayout for IE6+7*/
}
/* Hack for IE6 */
* html .frame-header {
    display: inline; /* Elements with hasLayout and display:inline behave like inline-block */
}
/* Hack for IE7 */
* + html .frame-header {
    display: inline; /* Elements with hasLayout and display:inline behave like inline-block */
}

IE7 does not support 'inline-block' properly, more info here: LINK
Use can use: 'inline' instead.

What exactly are you trying to achieve? Make us an example and put here: http://jsfiddle.net/


use inline, it works with this kind of selectors for list items:

ul li {}

or to be specific:

ul[className or name of ID] li[className or name of ID] {}

참고URL : https://stackoverflow.com/questions/6544852/ie7-does-not-understand-display-inline-block

반응형