twitter-bootstrap 在 Bootstrap 3 输入旁边放一些文字
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22209313/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 20:12:41 来源:igfitidea点击:
Put some text next to Bootstrap 3 input
提问by Martin Lunak
I have got the Bootstrap 3 code below:
我有下面的 Bootstrap 3 代码:
<div class="form-group">
<div class="col-sm-3 control-label">
<label>Surname:</label>
</div>
<div class="col-sm-9">
<input class="form-control" type="text" name="surname"><span>!</span>
</div>
And I need to show the exclamation mark next to the input, but it is always on the new line. How to put it nex to the input, please?
我需要在输入旁边显示感叹号,但它总是在新行上。请问如何把它放在输入后面?
Thanks
谢谢
回答by Jagadesh K
Use this code, it works
使用此代码,它的工作原理
<div class="form-group">
<div class="col-sm-3 control-label">
<label>Surname:</label>
</div>
<div class="col-sm-9">
<div class="input-group">
<input class="form-control" type="text" name="surname"><span class="input-group-addon">!</span>
</div>
</div>
回答by Zim
If your using a form-inlineit will work like this..
如果您使用form-inline它,它将像这样工作..
<form class="form-inline">
<div class="form-group">
<label>Surname:</label>
<input class="form-control" type="text" name="surname"> !
</div>
</form>

