W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<!DOCTYPE html> <html> <head> <script> function writeText(txt) { document.getElementById("desc").innerHTML = txt; } </script> </head> <body> <img src ="/i/eg_planets.jpg" alt="Planets" usemap ="#planetmap" /> <map name="planetmap"> <area shape ="rect" coords ="0,0,108,260" onmouseover="writeText('太阳和像木星这样的天然气巨行星是迄今为止太阳系中最大的天体。')" href ="/demo/planets_sun.html" target ="_blank" alt="Sun" /> <area shape ="circle" coords ="129,162,9" onmouseover="writeText('水星很难从地球上研究,因为它总是如此接近太阳。')" href ="/demo/planets_mercur.html" target ="_blank" alt="Mercury" /> <area shape ="circle" coords ="180,139,14" onmouseover="writeText('直到 20 世纪 60 年代,金星经常被认为是地球的孪生姐妹,因为金星是离我们最近的行星,因为这两个行星似乎有许多共同的特征。')" href ="/demo/planets_venus.html" target ="_blank" alt="Venus" /> </map> <p id="desc">将鼠标悬停在太阳和火星上,看看不同的描述。</p> </body> </html>