使用css/javascript在页面中所有图像的右上角动态放置一个按钮/div
我需要在网页中的每个图像上放置一个关闭按钮。我无法将图像正确放置在图像的右上角 函数初始化关闭按钮{ var trc=document.getElementsByClassName'top_right_corner'; forvar i=0;i更改.content和.content.top\u right\u角的CSS。绝对定位仅适用于内联块容器使用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; }
.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