Add and apply css to SVG AREA MAP - HTML CSS SVG

HTML CSS examples for SVG:polygon

Description

Add and apply css to SVG AREA MAP

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
polygon.hoverable<!--   ww w  .  ja va 2  s  .  c  o m-->
 {
   fill:transparent;
   stroke:gray;
   stroke-width:5;
   cursor:pointer;
}

polygon.hoverable:hover
 {
   stroke:black;
}
</style> 
 </head> 
 <body> 
  <p>Gray outline added for visibility. Can replace with 'none'.</p> 
  <svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg"> 
   <polygon class="hoverable" points="220,100 300,210 170,250" onclick="console.log('I am click functionality!');" /> 
  </svg>  
 </body>
</html>

Related Tutorials