1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| <!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<title>USEMAP</title>
<style>
#div_image{
position:relative;
width:216px;
height:90px;
}
#div_image img{
border:none;
position:relative;
}
#centre_image{
border:1px dotted #00f;
position:absolute;
top:20px;
left:50px;
width:116px;
height:50px;
}
</style>
</head>
<body>
<div id="div_image">
<div id="centre_image"></div>
<img src="http://www.developpez.net/template/images/logo.png" alt="logo" usemap="#map">
</div>
<map name="map">
<area shape="rect" coords="50,20,166,70" onclick="alert('centre image')">
<area shape="rect" coords="0,0,216,90" onclick="alert('out centre image')">
</map>
</body>
</html> |
Partager