How to indent without using <br> ? The fact is that <br> generates a newline character that is selected and copied along with the text, I need this character to not be.

  • And what should be instead of the newline character? Can CSS CSS indent? - koks_rs
  • Yes, whatever, the main thing is to have a single line indent, which is 1. It is not selected when selecting text 2. It corresponds to the width of the line (i.e., if you change the font so that its width matches the new font) - saroff
  • You can try to intercept the copy event and there you can process the copied text as you wish. developer.mozilla.org/en-US/docs/Web/API/HTMLElement/oncopy - koks_rs
  • Does <p> do the same? I don’t even know =) But yes, I would do it through margin / padding. - Telion

5 answers 5

Try something like this:

 <p class="margin-bottom-20"></p> 

And css:

 .margin-bottom-20 {display:block; margin-bottom:20px} 

Nothing will change, because no text

     body { font-size: 3em; } section { float: left; border: 1px solid; } div + div { margin-top: 1.15em; } 
     <section> <div>123</div> <br> <div>456</div> </section> <section> <div>123</div> <div>456</div> </section> 

      CSS to help you. margin-bottom: 20px;

      • If I change the font size, this indent will not change with it. - saroff

      And why you do not want to use the native <p> ? With CSS, you can customize for it the bottom margin (bottom) of the height of one line.

      • How can one margin be set in margin-bottom? It is not in pixels to fit, but so that if I put a different font / font size, was it correct? - saroff
      • @saroff; In this case, use the line-height property for this line with a value equal to twice the size of the current text. - kover-samolet

      Here you can play CSS

       .css { line-height: 2; //можно в консоли подогнать } 
      • Write down the solution to the problem in more detail so that users can understand it without any problems. To edit the answer, click edit . - Yuri