D
D
darkglare2020-11-16 19:44:52
Django
darkglare, 2020-11-16 19:44:52

How to move text to new line?

Can you please tell me how to transfer the text to a new line when displaying information from the database in the template?

{% for review in reviews %}
<div class="review_comment">

<p >{{review.author}}</p> 

 <p >{{review.date}}</p>

<h2>Достоинства</h2>

<p>{{review.plus|linebreaksbr}}</p>

<h2>Недостатки</h2>

 <p>{{review.minus|linebreaksbr}}</p>

<h2>Комментарий</h2>

 <p>{{review.comment|linebreaksbr}}</p>

</div>

      {% endfor %}


css file

.review_comment {
  margin:0 auto;
  margin-top:25px;
  border:solid 1px;

  
  padding:50px;
}

.review_comment h2 {
  margin:0 auto;
  margin-bottom:15px;
  margin-top:15px;
  font-size:20px;
  font-weight:700;

}

.review_comment p {
  margin:0 auto;
  margin-top:15px;javascript:void(0)
  font-size:14px;
  font-weight:400;
}


But in fact, this is how it happens 5fb2ac59cc16f474469488.jpegspecially limited by the frame border:solid 1px; How to apply linebreaks correctly

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
galaxy, 2020-11-16
@darkglare

linebreaksbr replaces line breaks with <br>, and what you have here is not that there are no line breaks, but also spaces.
If you have problems with long words, then https://css-tricks.com/almanac/properties/o/overfl...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question