为何IMG设置了useMap之后就出现了蓝边

tsing_feng 2007-05-09 03:15:09
//Hotspot div
this.hs_map = document.createElement("map");
this.hs_map.id = 'hs_map';
this.hs_map.name = 'hs_map';


this.hs_img = document.createElement("img");
this.hs_img.id = 'hs_img';
this.hs_img.name = 'hs_img';
this.hs_img.src = "image/hotspot.gif";
this.hs_img.useMap = '#hs_map';
this.hs_img.style.position = 'absolute';
this.hs_img.style.top = '0px';
this.hs_img.style.left = '0px';
this.hs_img.style.zindex = '1';
this.hs_img.onmousedown = null;

其中使用this.hs_img.useMap = '#hs_map'之后就使得图片左边和上边出现了蓝边,注释这句就没有,而map又没有相应的style,不知为何加上这个之后IMG的style就发生变化了.有熟悉的朋友请指教,谢谢!
...全文
556 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
aeoluszzf 2007-05-15
  • 打赏
  • 举报
回复
在a标签中的img也有这个情况,同样设置img的border=0就可以解决
zing02223 2007-05-15
  • 打赏
  • 举报
回复
如果在公共css里面定义了
img {
border:0;
}
后面也就不会出现类似问题了
tsing_feng 2007-05-09
  • 打赏
  • 举报
回复
试了,可用,太感谢了!

不知为何没有设置useMap时没有蓝边,设置以后就出现了.
zing02223 2007-05-09
  • 打赏
  • 举报
回复
尝试加上
this.hs_img.style.border = '0px';

61,112

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧