twitter-bootstrap 带 Bootstrap 的 HTML 新行
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/37398691/
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
HTML New Line with Bootstrap
提问by Grizzly
Using this reference, and the red alert option. Here it is:
使用此参考和红色警报选项。这里是:
<div class="alert alert-dismissible alert-danger">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong>Oh snap!</strong> <a href="#" class="alert-link">Change a few things up</a> and try submitting again.
</div>
In their example, there is a line break after try.. is that just because of width?
在他们的示例中,try之后有一个换行符.. 仅仅是因为宽度吗?
My version:
我的版本:
<div class="alert alert-dismissable alert-danger" style="float:right;">
<button type="button" class="close" data-dissmiss="alert">×</button>
<strong>Leave blank if there is already a Record for today! This will auto-calculate based on the previous Record.</strong>
</div>
Now mine doesn't have any line break but I also haven't messed with the CSS.. but I was wondering if there was a way to put a line break within the <strong>inline? I tried using this, but I guess that is strictly for <textarea>'s.
现在我的没有任何换行符,但我也没有弄乱 CSS .. 但我想知道是否有办法在内<strong>联中放置换行符?我尝试使用this,但我想那是严格用于<textarea>'s 的。
Any help is appreciated.
任何帮助表示赞赏。
回答by Wowsk
Just put a brtag wherever you want a line break. Notice the new line after record in the example below, due to the inserted <br>.
只需br在您想要换行的地方放置一个标签。请注意下面示例中记录后的新行,因为插入了<br>.
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<div class="alert alert-dismissable alert-danger" style="float:right;">
<button type="button" class="close" data-dissmiss="alert">×</button>
<strong>Leave blank if there is already a Record<br>for today! This will auto-calculate based on the previous Record.</strong>
</div>

