skip to Main Content

I’m working on a Forum project using Laravel 9 and for posting a new question, if I enter the text like this (without pressing Enter or adding </br>):

enter image description here

Then the body of the question will be shown like this:

enter image description here

And as you can see it overlaps the box that is in it and goes out which is wrong!

And this is the code for showing the body:

<div class="topic__text BYekan">
    <p>
        {{ $question->que_body }}
    </p>
</div>

So what’s going wrong here?

How can I solve this issue?

2

Answers


  1. You need styling, specifically

    topic__text p {
        overflow-wrap: break-word;
    }
    
    Login or Signup to reply.
  2. If you are using one of laravel starter kit, you must be using tailwind.

    Here you can find class that most suitable to your need.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search