나는 배경 이미지가있는 컨테이너 (div)가 있습니다. 이 div에는 수평 목록 인 메뉴가 있습니다. 내가 필요로하는 것은 onMouseOver 이미지를 삽입하고 절대적으로 위치를 지정하고 텍스트 뒤에 표시하는 것입니다 (물론!) div의 배경 이미지 위에 표시합니다. 또한 jQuery를 사용하지만이 것은 중요하지 않다고 생각합니다. 문제는 온라인으로 볼 수 있습니다. http://www.w3schools.com/css/tryit.asp?filename=trycss_zindex로 이동하고 다음 텍스트 당신이 z-index
을 적용하려면 사업부에 position:relative;
, absolute
또는 fixed
필요 보인다Z- 색인 및 자바 스크립트 롤오버
<html> <head> <style type="text/css"> img { top: 0; left: 0; position:absolute; z-index:-1; } #main { color: red; margin: 30px; padding: 20px; width: 700px; min-height: 400px; z-index: -2; background-image: url("http://www.google.com/logos/mother10-hp.gif"); background-repeat: no-repeat; } </style> </head> <body> <div id="main"> <h1>Z-Index question:</h1> <img src="w3css.gif" width="100" height="140" /> <p>How can we place the green pic between the text and the div#main?</p> <p>I need the green gif to appear</p> <ol> <li>On top of #main's background image</li> <li>Behind the text</li> </ol> </div> </body> </html>
고맙습니다. 그것은 내 문제를 해결했다 – Raffaele
내가 도울 수있어서 기뻐. –