如何将此正确放置在 css 位置?

How to place this correct with position css?

我有一个带有 weight:100% 的 < div > 并且应该在右侧放置一个按钮。但是我的代码不起作用。 谁能帮我看看为什么?

<div style="width:100%">
   <span>some text</span>
   <input style="position:relative; right:0px;" type="button"/>
</div>

Div 必须是相对的,按钮是绝对的。

 <div style="width:100%; position: relative;">
    <span>some text</span>
    <input style="position:absolute; right: 0px;" type="button"/>
 </div>