Jump to content

quando passar o cursor sobre a imagem aparecer legenda


alexmestre
 Share

Recommended Posts

como asssim eu tenho isto:

<div id='pai'>
    <a href="iframe/V2 - Laranja/V2-Laranja.html"><img src="images/menu/foto 1 min 1.jpg" onMouseOver="this.src='images/menu/foto 1 min 2.jpg'" onMouseOut="this.src='images/menu/foto 1 min 1.jpg'" /></a>

   <div id="sera-mostrada">
      <p>V2 - Laranja</p>
  </div>
</div>

e o css é :

#pai #sera-mostrada {
display:none;
left:inherit;
position:inherit;
}
#pai:hover #sera-mostrada {
display:block
}

Link to comment
Share on other sites

<html>
  <head>
    <style>
#pai {
background-color: #ddd;
height: 82px; /* ajustar ao tamanho da imagem */
}
#pai img {
height: 82px; /* ajustar ao tamanho da imagem */
background-color: #999;
}
#pai #sera-mostrada {
        display:none;
        left:inherit;
position: relative;
top: -20px; /* ajustar a altura pretendida */
}
#pai #sera-mostrada p {
margin: 0;
        height: 20px; /* ajustar a altura pretendida */
}
#pai:hover #sera-mostrada {
        display:block;
}
    </style>
  </head>
  <body>
    <div id='pai'>
      <a href="iframe/V2 - Laranja/V2-Laranja.html">
        <img src="images/menu/foto 1 min 1.jpg" onMouseOver="this.src='images/menu/foto 1 min 2.jpg'" onMouseOut="this.src='images/menu/foto 1 min 1.jpg'" />
      </a>
      <div id="sera-mostrada">
        <p>V2 - Laranja</p>
      </div>
    </div>
  </body>
</html>

--

Edit(brunoais):

  • Identificação da linguagem das tags code (estava mal escrito)
IRC : sim, é algo que ainda existe >> #p@p
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.