5

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.

 <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>
Scott
  • 471
  • 3
  • 9
  • 19
  • 2
    note that using line breaks for positioning, formatting, and clearing content is a task better suited to CSS than HTML, so you may not want to use
    at all. see [this](http://stackoverflow.com/questions/3937515/when-to-use-br-line-breaks-vs-css-positioning) SO discussion
    – danyamachine Sep 30 '15 at 01:09

6 Answers6

12

change <br> to <div class="hidden-xs hidden-md hidden-lg"></div>

it should help

sglazkov
  • 1,046
  • 1
  • 10
  • 38
3

These clases hidden-md etc. has been dropped from stable Bootstrap 4. Use these instead: .d-sm-none .d-md-block

lukyer
  • 7,595
  • 3
  • 37
  • 31
2

This work for me.

<br class="hidden-xs"/>

Hope it helps!

elmondino
  • 33
  • 4
0

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:

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;
   }
 }
Fahad
  • 99
  • 7
0

You can do as following:

<br class="d-none d-sm-inline" />

But it may not be cross-browser.

Ivan Aracki
  • 4,861
  • 11
  • 59
  • 73
Yatko
  • 8,715
  • 9
  • 40
  • 46
0

With Bootstrap 5 it is:

<br class="d-md-none">

To show it only on large screens and up, it would be:

<br class="d-none d-lg-block">

https://getbootstrap.com/docs/5.1/utilities/display/#hiding-elements