本文介绍了CSS向右浮动...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试将一个按钮元素浮动到右侧,但它没有按我期望的那样工作.
这没有"float:right;"
http://i.imgur.com/wSQxs.png [ ^ ]
然后,当我添加"float:right;"时,它会转到下一行.
http://i.imgur.com/QfEl2.png [ ^ ]
我如何使按钮停靠在灰色框的最右边?
I''m trying to float a button element to the right and it isn''t working as I would expect.
This is without "float:right;"
http://i.imgur.com/wSQxs.png[^]
And then it goes down to the next line when I add "float:right;".
http://i.imgur.com/QfEl2.png[^]
How would I make the button dock on the very right side of the gray box?
推荐答案
<div style="width: 50%;">
<div style="float: none;">
your text comes here
</div>
<div style="float: left;">
<input type="text" id="txtid" />
</div>
<div style="float: right;">
<input type="button" value="okay" />
</div>
</div>
<asp:Panel runat="server" ID="textPanel" BorderColor="Black" BorderWidth="2">
<label>Dock float</label>
<input style="float: right;" type="button" value="PressMe" />
</asp:Panel>
虽然,我确实找到了VS设计器,将它作为您的图像显示在下一行中,但是运行我的应用程序时,一切符合预期.试试吧.
Though, I did find VS designer showing it on the next line as your image, but things were as per expectation when I run the app. Try out.
这篇关于CSS向右浮动...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!