The question is essentially stupid, so I don’t really want to spend time also explaining the situation where I needed it. Just wondering how this is valid and generally allowed?

Questioned by the fact that I have never seen anybody <br> with classes :)

Although it is understandable, there was no need.

  • one
    Most likely, yes, you can choose the height of the gap. - Nikita
  • one
    Yes, you can for example: <br class="hidden-xs"> (for bootsrap 3) - soledar10
  • 2
    Absolutely any tags can have classes, and even br sometimes has a need - andreymal
  • So tnank you! Doubts dispelled) - Jimmy

2 answers 2

Yes you can. And some browsers (at least in chrome) can even be styled if you specify content .

 .skip { display: none; } .styled { content: ""; display: block; height: 3em; background: red; } 
 123<br> 456<br class="styled"> 789<br class="skip"> 012 

    It does not display anything. He has only the attribute <br clear="свойство"> " <br clear="свойство"> ". And no one ever uses it. So there is a functionality for managing the tag.

    • 2
      The clear attribute is deprecated and replaced with the clear CSS property. And this CSS property can be set via - surprise! - class - andreymal
    • When using js in rare cases, for example, in mine, class assignment helps a lot. As for the styles, the tag itself is quite enough, I agree with that. - Jimmy
    • I myself have never thought about it. And in principle, I never use this tag. Usually, all layout elements are controlled through blocks. If you need to transfer something, then <p> or <span> used. I use it only if I need to transfer something in the html code itself, when debugging a php script, for example. - Denis
    • @Denis, visually yes, indentation can achieve the same effect. But there is one BUT: if it is important that when copying text between paragraphs or something else there is a real line break, then the styles will no longer help. This is the very thing for this. - Jimmy