No replies
friv
friv's picture
Offline
newbie
Last seen: 7 years 27 weeks ago
Timezone: GMT+2
Joined: 2012-07-14
Posts: 1
Points: 2

Hi guys, I'm trying to show a tooltip everytime you hover an image but it appears behind other elements. I'm not an expert so I don't know if the problem is with the css or the html. I've tried to add z-index but couldn't fix it. Can anyone help me please?

HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"/>
<title>----------</title>
<link rel="stylesheet" type="text/css" href="css/style.css"/>
</head>
<body>
<div id="wrapper">
	<h1>------------------</h1>
	<h2></h2>
	<div id="content">
		<ul id="movieposters">
			<li>
				<img src="images/boris.jpg" alt="El Ataque del Monstruo Marino" />
				<div style="z-index:100;" class="movieinfo">
					<h3><a href="http://www.imdb.com/title/tt1104001/">El Ataque del Monstruo Marino</a></h3>
					<p style="z-index:100;">Sam Flynn, the tech-savvy 27-year-old son of Kevin Flynn, looks into his father's disappearance and finds...</p>					
				</div>
			</li>            
			<li>
				<img src="images/boris.jpg" alt="El Ataque del Monstruo Marino" />
				<div class="movieinfo">
					<h3><a href="http://www.imdb.com/title/tt1104001/">El Ataque del Monstruo Marino</a></h3>
					<p>Sam Flynn, the tech-savvy 27-year-old son of Kevin Flynn, looks into his father's disappearance and finds...</p>					
				</div>
			</li>            
			<li>
				<img src="images/boris.jpg" alt="El Ataque del Monstruo Marino" />
				<div class="movieinfo">
					<h3><a href="http://www.imdb.com/title/tt1104001/">El Ataque del Monstruo Marino</a></h3>
					<p>Sam Flynn, the tech-savvy 27-year-old son of Kevin Flynn, looks into his father's disappearance and finds...</p>					
				</div>
			</li>
            <li>
				<img src="images/boris.jpg" alt="El Ataque del Monstruo Marino" />
				<div class="movieinfo">
					<h3><a href="http://www.imdb.com/title/tt1104001/">El Ataque del Monstruo Marino</a></h3>
					<p>Sam Flynn, the tech-savvy 27-year-old son of Kevin Flynn, looks into his father's disappearance and finds...</p>					
				</div>
			</li>
			<li>
				<img src="images/boris.jpg" alt="El Ataque del Monstruo Marino" />
				<div class="movieinfo">
					<h3><a href="http://www.imdb.com/title/tt1104001/">El Ataque del Monstruo Marino</a></h3>
					<p>Sam Flynn, the tech-savvy 27-year-old son of Kevin Flynn, looks into his father's disappearance and finds...</p>					
				</div>
			</li>
            <li>
				<img src="images/boris.jpg" alt="El Ataque del Monstruo Marino" />
				<div class="movieinfo">
					<h3><a href="http://www.imdb.com/title/tt1104001/">El Ataque del Monstruo Marino</a></h3>
					<p>Sam Flynn, the tech-savvy 27-year-old son of Kevin Flynn, looks into his father's disappearance and finds...</p>					
				</div>
			</li>
			<li>
				<img src="images/boris.jpg" alt="El Ataque del Monstruo Marino" />
				<div class="movieinfo">
					<h3><a href="http://www.imdb.com/title/tt1104001/">El Ataque del Monstruo Marino</a></h3>
					<p>Sam Flynn, the tech-savvy 27-year-old son of Kevin Flynn, looks into his father's disappearance and finds...</p>					
				</div>
			</li>
            <li>
				<img src="images/boris.jpg" alt="El Ataque del Monstruo Marino" />
				<div class="movieinfo">
					<h3><a href="http://www.imdb.com/title/tt1104001/">El Ataque del Monstruo Marino</a></h3>
					<p>Sam Flynn, the tech-savvy 27-year-old son of Kevin Flynn, looks into his father's disappearance and finds...</p>					
				</div>
			</li>
			<li>
				<img src="images/boris.jpg" alt="El Ataque del Monstruo Marino" />
				<div class="movieinfo">
					<h3><a href="http://www.imdb.com/title/tt1104001/">El Ataque del Monstruo Marino</a></h3>
					<p>Sam Flynn, the tech-savvy 27-year-old son of Kevin Flynn, looks into his father's disappearance and finds...</p>					
				</div>
			</li>
		</ul>
	</div>
</div>
</body>
</html>

CSS

/* BASIC RESET */
ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,body,html,p,blockquote,fieldset,input{margin:0; padding:0;}
 
/* HTML ELEMENTS */
body { background-color:#deddcd; font:14px/21px Arial,Helvetica,sans-serif; }
h1 { font: bold 65px/60px Helvetica, Arial, Sans-serif; text-align: center; color: #eee; text-shadow: 0px 2px 6px #333; }
h1 small{ font-size: 20px; text-transform:uppercase; letter-spacing: 14px; display: block; color: #000; }
h2 a { display: block; text-decoration: none; margin: 0 0 30px 0; font: italic 45px Georgia, Times, Serif;  text-align: center; color: #bfe1f1; text-shadow: 0px 2px 6px #333; }
h2 a:hover { color: #90bcd0; }
 
/* COMMON CLASSES */
.break { clear:both; }
 
/* WRAPPER */
#wrapper { width:960px; margin:0px auto; }
 
/* CONTENT */
#content { }
#content .info { padding:10px; }
 
/* MOVIE POSTERS */
#movieposters { list-style:none; margin:000px 0; height:133px; }
#movieposters li { display:inline; float:left; margin-bottom:-200px;
	-webkit-perspective: 500; -webkit-transform-style: preserve-3d;
	-webkit-transition-property: perspective; -webkit-transition-duration: 0.5s; }
#movieposters li:hover { -webkit-perspective: 5000; }
 
#movieposters li img { border:5px solid #fcfafa; -webkit-transform: rotateY(30deg);
	-moz-box-shadow:0 3px 10px #888; -webkit-box-shadow:0 3px 10px #888;
	-webkit-transition-property: transform; -webkit-transition-duration: 0.5s; }
#movieposters li:hover img { -webkit-transform: rotateY(0deg); }
 
.movieinfo { border:5px solid #fcfafa; padding:20px; width:180px; height:180px; background-color:#deddcd; margin:0px 0 0 0px;
	border-radius: 50%;
	bottom: -40px;
	opacity: 0;
	box-shadow: 0px 3px 8px rgba(0,0,0,0.1);
	-webkit-transform: scale(0.2);
	-moz-transform: scale(0.2);
	-o-transform: scale(0.2);
	-ms-transform: scale(0.2);
	transform: scale(0.2);
	-webkit-transition: all 0.3s ease-in-out;
	-moz-transition: all 0.3s ease-in-out;
	-o-transition: all 0.3s ease-in-out;
	-ms-transition: all 0.3s ease-in-out;
	transition: all 0.3s ease-in-out; }
 
#movieposters li:hover .movieinfo {
	opacity: 0.9;
	bottom: 50px;
	-webkit-transform: scale(1);
	-moz-transform: scale(1);
	-o-transform: scale(1);
	-ms-transform: scale(1);
	transform: scale(1); }
 
.movieinfo h3 { color:#7a3f3a; font-variant: small-caps; font-family:Georgia,serif,Times; text-align:center; padding-bottom:10px; }
.movieinfo p { padding-bottom:5px; font-size: 11px; text-align:center; }
.movieinfo a { color:#7a3f3a; text-decoration: none; font-variant: small-caps; font-family:Georgia,serif,Times; text-align:center; padding-bottom:0px; }
.movieinfo a:hover, .movieinfo a:focus { background-color:#6a191f; color:#fff; }