Javascript 将输入按钮的文本拆分为两行,位于另一行的顶部
我有一个输入按钮,我想将文本“Estimate Shipping”设置为: “估计值Javascript 将输入按钮的文本拆分为两行,位于另一行的顶部,javascript,jquery,html,css,twitter-bootstrap,Javascript,Jquery,Html,Css,Twitter Bootstrap,我有一个输入按钮,我想将文本“Estimate Shipping”设置为: “估计值 航运” 相反。我该怎么做 这是我的名片 示例HTML: <div class="span12"> <form class="form-vertical form-inline" id="ShipEstimate" novalidate="novalidate"> <div class="control-group floating-label-form-gr
航运” 相反。我该怎么做 这是我的名片 示例HTML:
<div class="span12">
<form class="form-vertical form-inline" id="ShipEstimate" novalidate="novalidate">
<div class="control-group floating-label-form-group">
<fieldset>
<div class="controls">
<label for="PostalCode_Ship" title="Zip">
Enter Zipcode:
</label>
<input type="text" id="PostalCode_Ship" value="45356" name="PostalCode_Ship" onchange="populateCartTotalInCartPage();" minlength="5" placeholder="Enter Zipcode">
<input type="hidden" id="Country_Ship" name="Country_Ship" value="US">
<input type="button" onclick="populateCartTotalInCartPage();" value="Estimate Shipping" id="GetQuotes" class="btn btn-orange">
<input type="radio" style="display:none" id="shipping_method" name="shipping_method" value="1000022" onchange="populateCartTotalInCartPage();">
<input type="radio" style="display:none" id="shipping_method" name="shipping_method" value="1000001" onchange="populateCartTotalInCartPage();">
<input type="radio" style="display:none" id="shipping_method" name="shipping_method" value="1000004" onchange="populateCartTotalInCartPage();">
<input type="radio" style="display:none" id="shipping_method" name="shipping_method" value="1000005" onchange="populateCartTotalInCartPage();">
<input type="radio" style="display:none" id="shipping_method" name="shipping_method" value="1000009" onchange="populateCartTotalInCartPage();">
<input type="radio" style="display:none" id="shipping_method" name="shipping_method" value="1000010" onchange="populateCartTotalInCartPage();">
</div></fieldset>
</div>
</form>
</div>
输入Zipcode:
试试这个
估计值
航运
为了断开按钮输入值,您可以使用
代码>(HTML实体)如下“
您还可以使用
元素将第二个单词移动到下一行:
<button>
Hello <br>
World!
</button>
你好
世界!
使用CSS设置按钮的宽度,以便第二个单词换行到下一行。或者,您也可以使用
标记:
<button>
Estimate<br />
Shipping
</button>
估计值
航运
分词法可以帮你做到这一点
#getQuotes
{
width: 94px;
word-break: break-word;
}
您可以使用内联style
属性,如下所示
<input type="button" onclick="populateCartTotalInCartPage();" value="Estimate Shipping" id="GetQuotes" class="btn btn-orange" style="width:90px !important;word-break: break-word;">
这里的问题是什么?或者估算和#x00A;装运
为十六进制;-)
#getQuotes
{
width: 94px;
word-break: break-word;
}
<input type="button" onclick="populateCartTotalInCartPage();" value="Estimate Shipping" id="GetQuotes" class="btn btn-orange" style="width:90px !important;word-break: break-word;">