2012-01-13 3 views
1

현재 IE에서 내 z- 색인에 문제가 있습니다.Internet Explorer의 이미지 위에있는 텍스트

이 div에는 이미지가 있고이 이미지 위에는 일부 텍스트가 있습니다.

내가 몇 가지를 발견 ...

#content_right { 
width: 230px; 
height: 484px; 
float: right; 
} 

.mini_bloc_image { 
height: 148px; 
margin-bottom: 20px; 
position: relative; 
} 

.mini_bloc_image > img { 
position: absolute; 
} 

.mini_bloc_image > span:first-of-type { 
display: block; 
position: absolute; 
top: 95px; 
left: 0px; 
font-size: 1.1em; 
background-color: #ffffff; 
padding: 4px 5px 4px 5px; 
} 

.mini_bloc_image > span:last-of-type { 
display: block; 
top: 95px; 
left: 0px; 
position: absolute; 
left: 50px; 
top: 125px; 
color: #ffffff; 
font-size: 1.1em; 
font-family: 'Marck Script', cursive; 
} 

IE 이미지 이상이어야 내 텍스트를 이해하지 않습니다

<section id="content_right"> 

        <div class="mini_bloc_image"> 
         <img alt="Camionnette VCI" src="img/mini_reparation_site_nb.png" /> 
         <span><a href="#">R&eacute;paration sur site</a></span> 
         <span>Nous nous d&eacute;pla&ccedil;ons</span> 
        </div> 

와 CSS : 여기

내 HTML 코드입니다 http://www.adrenatie.com/z-index-et-ie6/ 또는 http://systembash.com/content/css-z-index-internet-explorer/과 같은 솔루션이 있지만 작동하지 않습니다.

누군가 나를 도와 줄 수 있습니까?

+0

IE6에 대해 구체적으로 묻고 있습니까? – vcsjones

+0

정말 필요하십니까 : first-of-type 및 last-of-type? –

+0

그들은 같은 글꼴 및 apparence가 없기 때문에 나는 그렇다고 생각한다. – Greg

답변

2

문제는 기본적으로 인라인으로 렌더링되는 span입니다. 당신이 display:block를 사용하는 경우, Z- 인덱스가 사용됩니다 :

.mini_bloc_image > span:first-of-type { 
display: block; 
position: absolute; 
z-index: 10; 
font-size: 1.1em; 
background-color: #ffffff; 
padding: 4px 5px 4px 5px; 
margin-top: 95px; 
} 

.mini_bloc_image > span:last-of-type { 
display: block; 
position: absolute; 
z-index: 10; 
color: #ffffff; 
font-size: 1.1em; 
font-family: 'Marck Script', cursive; 
margin-left: 30%; 
margin-top: 125px; 
} 

인라인 요소 및 위치에 대한 자세한 내용은 this article를 참조하십시오.

+0

@Greg 또한 IE에는 "인덱스"스택이 재설정되는 "버그"가 있습니다. 나는 이것이 당신이 겪고있는 문제라고 생각하지 않으며 Prutswonder의 해결책이 옳다고 생각합니다. 그러나 만약 당신이 experiance z-index 문제를 가지고 있다면 부모의 요소는 z-index가없고 child-elements는 z-index가 DOM 트리보다 높은 요소를 덮어 쓰지 않을 수도 있습니다. 이것은 종종 드롭 다운 메뉴에서 발생하며 IE 6, 7 및 아마도 8 문제라고 생각합니다. IE 9에는이 문제가 없다고 생각합니다. 그냥 메모로. – jmbertucci

+0

범위가 HTML 및 DOM 트리의 이미지 뒤에 있으므로 레코드의 경우 Z- 인덱스가 필요하지 않습니다. 일반적으로 포지셔닝이 DOM 트리의 흐름을 따르지 않는 경우 z- 인덱스 만 변경하면됩니다. – Prutswonder

+0

답변 해 주셔서 감사합니다. 나는 그것을 시험해 보았고 divs에 의해 나의 범위를 대체하려고 시도했지만 작동하지 않았다. 내 텍스트는 항상 내 이미지 아래에 있습니다. 멋진 기사 주셔서 감사합니다. [편집 : 난 그냥 Fozzyuw의 코멘트를 읽고 뭔가를 시도] – Greg