0

这是我的代码...我尝试给出style="position: relative; right:0; top:0;" 在里面标签。但是,它没有出现在那个位置。

//样式标签

.thumb {
    height: 75px;
    border: 1px solid #000;
    margin: 10px 5px 0 0;
    display: inline-block;
    position: relative;
}
span.innerHTML = [
    '<a href="#" class="delete" id="x"><i class=" icon-remove-sign "position: relative;
    style="top:0; right:0;" ></i><img class="thumb" src="', e.target.result, '" title="', escape(theFile.name), '" width="130" height="150"/></a>' 
].join('');
     document.getElementById('list').insertBefore(span, null);
};
4

1 回答 1

0

改为使用position:absolute,但如果它破坏了流程,请将锚点设置positionrelative. 您还可以将锚点设为inline-block元素。

您的代码示例也有一些无效的 HTML。将<i>标签移动到标签之后<img>

查看这个jsFiddle以获取 HTML 和 CSS 示例

于 2013-07-24T06:48:09.267 回答