Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用css/javascript在页面中所有图像的右上角动态放置一个按钮/div_Javascript_Jquery_Html_Css - Fatal编程技术网

使用css/javascript在页面中所有图像的右上角动态放置一个按钮/div

使用css/javascript在页面中所有图像的右上角动态放置一个按钮/div,javascript,jquery,html,css,Javascript,Jquery,Html,Css,我需要在网页中的每个图像上放置一个关闭按钮。我无法将图像正确放置在图像的右上角 函数初始化关闭按钮{ var trc=document.getElementsByClassName'top_right_corner'; forvar i=0;i更改.content和.content.top\u right\u角的CSS。绝对定位仅适用于内联块容器 .content { position: relative; width: 33%; display: inline-block; }

我需要在网页中的每个图像上放置一个关闭按钮。我无法将图像正确放置在图像的右上角

函数初始化关闭按钮{ var trc=document.getElementsByClassName'top_right_corner'; forvar i=0;i更改.content和.content.top\u right\u角的CSS。绝对定位仅适用于内联块容器

.content {
  position: relative;
  width: 33%;
  display: inline-block;
}
.content .top_right_corner {
  position: absolute;
  top: 5px;
  right: 52px;
}
在跨度中使用float:left;在跨度中使用float:right;在div中使用float:3px;在div中使用float:top:3px

函数初始化关闭按钮{ var trc=document.getElementsByClassName'top_right_corner'; forvar i=0;i