有没有办法在这个"hovered"标志中添加图片?



我正在制作一个网站,当我悬停在一个句子上时,我设法使一个标志出现。在这个标志里面有一个文字,但是现在我想添加一个图片。这可能吗?我该怎么做呢?

澄清一下,当我把鼠标从句子上移开时,我想让符号内的图片消失。就像符号本身和文本一样

这是我的代码的一个例子:


<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Documento sin título</title>
<link rel="stylesheet" href="mihojadeestilosTSlyrics.css"/>
<script src="jQueryAssets/jquery-1.11.1.min.js"></script>   

<script>    

$(document).ready(function(){   
$("#mensaje_frase0").hide();
$("#frase0").hover(mensaje_on0, mensaje_off0);

});

function mensaje_on0(){
$("#mensaje_frase0").show();
}

function mensaje_off0(){
$("#mensaje_frase0").hide();
}

</script>

</head>
<style> 

body
{
background:url("../imagenes/speaknow/longlive.jpg"); /*La foto*/
background-repeat:repeat-y;
background-position:120% 0%;

}   

#mensaje_frase0{
position: fixed;  /*queda en donde lo pusimos aunque cambiemos de posicion con la barra de desplazamiento*/
left: 625px;
top: 170px;   /*el espacio entre el cuadro y el tope VISIBLE de arriba*/
width: 500px;  /*el ancho del cuadro. (el texto se acomoda adentro)*/
height: 230px;
background-color: #D7CFDA;
font-size: 23px;
padding: 25px;   /*El margen entre el texto y los bordes del cuadro*/
padding-top: 40px;
border: 2px #00F;
font-family: Segoe, "Segoe UI", "DejaVu Sans", "Trebuchet MS", Verdana, "sans-serif";
text-align: center;
}   

</style>    

<body>

<div id="mensaje_frase0">THIS IS SOME TEXT INSIDE THE SIGN. I WANT TO ATTACH A PICTURE HERE TOO.</div>

<h1><span id="frase0">Long Live</span></h1>
</body>
</html>

在div内添加:

<image src='<Image file here>'>

除了要确保将更改为实际的图像文件位置。

最新更新