使用jQuery定位按钮

使用jQuery定位按钮,jquery,button,position,Jquery,Button,Position,我正试图用Jquery将一个按钮放在图像的正下方/正后方 该按钮只是一个带有一些javascript的div: <div id="printer" onclick="window.open('./print','Printer', 'resizable=yes');"> 有人能帮我吗 您可以在此处查看屏幕截图:- 您可以查看此页面的来源:-简单: $('#printer').insertAfter('.entry-content img:first'); 您还必须移除浮动。理想

我正试图用Jquery将一个按钮放在图像的正下方/正后方

该按钮只是一个带有一些javascript的div:

<div id="printer" onclick="window.open('./print','Printer', 'resizable=yes');">
有人能帮我吗

您可以在此处查看屏幕截图:-

您可以查看此页面的来源:-

简单:

$('#printer').insertAfter('.entry-content img:first');

您还必须移除浮动。理想情况下,这应该通过CSS完成。如果不可能,请使用以下方法:

$('#printer').insertAfter('.entry-content img:first').css('float', 'none');
简单:

$('#printer').insertAfter('.entry-content img:first');

您还必须移除浮动。理想情况下,这应该通过CSS完成。如果不可能,请使用以下方法:

$('#printer').insertAfter('.entry-content img:first').css('float', 'none');

使用CSS添加
display:block
属性。

使用CSS添加
display:block
属性。

添加此CSS

#printer { position:absolute; top:280px; margin:0; }
.qa-main { position:relative; }
添加这个css

#printer { position:absolute; top:280px; margin:0; }
.qa-main { position:relative; }