本文介绍了2个具有相同宽度的html按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
希望这是一个简单的问题.
我有2个按钮,文本长度不同.我想两者都具有相同的长度/宽度.有一种简单的方法可以得到这个吗?
Hey all,
it´s an easy question, hopefully.
I have 2 buttons, text lengh is different. I want to have both with the same lengh/width. Is there an easy way to get this?
<asp:Button ID="Button_Config_iPhone"
runat="server"
onclick="Button_CreateConfiguration_iPhone4"
Text="iPhone"
ToolTip="iPhone "
/><br /><br />
<asp:Button ID="Button_Config_WinMob"
runat="server"
onclick="Button_CreateConfiguration_WindowsMobile"
Text="Windows Mobile Phone"
ToolTip="Windows Mobile Phone"
/><br /><br />
我不想使用width = int pxt或%...
我想动态地填充按钮的文本,超过2个,然后它们都应该具有与最大按钮相同的宽度...
I don´t want to use width= int pxt or %...
I want to fill the text of the buttons dynamicly, more than 2, and then they should all have the same width like the largest...
推荐答案
<asp:button id="Button_Config_iPhone" runat="server" onclick="Button_CreateConfiguration_iPhone4" text="iPhone" tooltip="iPhone" xmlns:asp="#unknown">width="40%" />
</asp:button>
<style type="text/css">
input[type=submit]
{
width:80px;
}
</style>
<asp:button id="buttton1" runat="server" onclick="Button_CreateConfiguration_iPhone4" text="iPhone" tooltip="iPhone" xmlns:asp="#unknown">width="40" />
</asp:button>
<asp:button id="button2" runat="server" onclick="Button_CreateConfiguration_iPhone4" text="iPhone" tooltip="iPhone" xmlns:asp="#unknown">width="40" />
</asp:button>
这篇关于2个具有相同宽度的html按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!