看下面的 fiddle :
<div style="display:inline-block;margin-right:5px">
<button type=button id="fdfdd" class="btn btn-small" style="width:150px;">sadfasfdsfdfd</button>
</div>
我希望按钮位于页面右侧 5 像素处。
我试过使用 margin-right witch 没有用。
最佳答案
你可以定位你的元素 absolute
然后使用 css right
像:
<div style="display:inline-block; position:absolute; right:5px;">
<button type=button id="fdfdd" class="btn btn-small" style="width:150px;">sadfasfdsfdfd</button>
</div>
也看看你的jsfiddle
关于css - 如何将像素定位到右侧,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26553123/