<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>CSS之图片关闭</title><script language="javascript"><br />//关闭事件 function shut(){ document.getElementById("close").style.display="none"; }</script><style type="text/css">body { margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; text-align:center;}</style></head><body><div id="close"><img src="Image/start.jpg" /><br /><a href="javascript:shut()">关闭</a></div></body></html>
実行効果は次の図に示すとおりです。