twitter-bootstrap 无法在 Bootstrap 中隐藏 <br>
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/32856080/
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
Can't hide a <br> in Bootstrap
提问by Scott
For some reason I can't hide the <br>tags only show up on small screen sizes. It doesn't show up for small screens. It works for the other screen sizes. It works for other tags. Something about the <br>tags with the small screen size.
出于某种原因,我无法隐藏<br>仅在小屏幕上显示的标签。它不会出现在小屏幕上。它适用于其他屏幕尺寸。它适用于其他标签。关于<br>小屏幕尺寸的标签。
<div class="row">
<img src="static/works_3.jpg" class="img-responsive works-photo col-md-4 col-sm-12"><br class="hidden-xs hidden-md hidden-lg">
<img src="static/works_3.jpg" class="img-responsive works-photo col-md-4 col-sm-12"><br class="hidden-xs hidden-md hidden-lg">
<img src="static/works_3.jpg" class="img-responsive works-photo col-md-4 col-sm-12"><br class="hidden-xs hidden-md hidden-lg">
</div>
回答by sglazkov
change <br>to <div class="hidden-xs hidden-md hidden-lg"></div>
更改<br>为<div class="hidden-xs hidden-md hidden-lg"></div>
it should help
它应该有帮助
回答by elmondinio
This work for me.
这对我有用。
<br class="hidden-xs"/>
<br class="hidden-xs"/>
Hope it helps!
希望能帮助到你!
回答by lukyer
These clases hidden-mdetc. has been dropped from stable Bootstrap 4. Use these instead: .d-sm-none .d-md-block
这些类hidden-md等已从稳定的 Bootstrap 4 中删除。请改用这些:.d-sm-none .d-md-block
回答by Fahad
I usually don't give classes to line break tags. My sass is usually like this. In this particular case, I am showing on larger screens i.e 'lg' and above breakpoints. I am hiding the line break tag otherwise.
我通常不给换行标签上课。我的sass通常是这样的。在这种特殊情况下,我在更大的屏幕上显示,即“lg”和以上断点。否则我将隐藏换行标记。
This keeps the markup clean. Example:
这使标记保持干净。例子:
I usually don't give classes to line break tags. My sass is usually like this. In this particular case, I am showing on larger screens i.e 'lg' and above breakpoints. I am hiding the line break tag otherwise.
This keeps the markup clean. Example:
这使标记保持干净。例子:
br {
display: none;
@include media-breakpoint-up(lg) {
display: block;
}
}
回答by Yatko
You can do as following:
您可以执行以下操作:
<br class="d-none d-sm-inline" />
But it may not be cross-browser.
但它可能不是跨浏览器。

