Home > database >  Question Body Goes Out Of The Box When Showing It At Blade
Question Body Goes Out Of The Box When Showing It At Blade

Time:02-06

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 ):

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 >
    <p>
        {{ $question->que_body }}
    </p>
</div>

So what's going wrong here?

How can I solve this issue?

CodePudding user response:

You need styling, specifically

topic__text p {
    overflow-wrap: break-word;
}

CodePudding user response:

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.

  • Related