1. ホーム
  2. ハイパーリンク

[解決済み] [Solved] How to change the height of a <br>?

2022-03-28 22:10:18

Question

I have a big paragraph of text that is divided into subparagraphs with <br> 's:

<p>
  Blah blah blah.
  <br/>
  Blah blah blah. Blah blah blah. Blah blah blah.
  <br/>
  Blah blah blah.
</p>

I want to widen the gap between these subparagraphs, like there is two <br> 's or something like that. I know that the right way to do this is to use <p></p> , but right now I cannot change this layout, so I am looking for CSS-only solution.

I've tried setting <br> 's line-height and height with display: block , I also Googled and Stack Overflow-ed briefly, but did not find any solution. Is this even possible without changing the layout?

解決方法は?

CSSを使用します。

br {
   display: block;
   margin: 10px 0;
}

この解決策は、おそらくクロスブラウザー互換ではありませんが、少なくとも何かはあります。また line-height :

line-height:22px;

Google Chromeの場合。 考える 設定 content :

content: " ";

それ以外は、JavaScriptの解決策に行き詰まると思います。