0

I want to put HTML code that I am getting from the MySQL database into my HTML page. I am using [innerHtml], but the div width is larger than the page max-width. How can I solve the problem?

CSS

.sonclass {
 display: inline-flex;
 max-width: 1300px;
}

.fatherclass {
  width: 1300px;
}

HTML

  <div class="fatherclass">
    <div class="sonclass" [innerHTML]="data.html"></div>
  </div>
2
  • 1
    add what you tried Commented Aug 20, 2019 at 8:43
  • Hope, you have tried something useful Commented Aug 20, 2019 at 8:49

1 Answer 1

1

You could try a word-wrap: break-word; on your innerHTML element to break it into a paragraph

You have to remove the display:inline-flex for it to work however

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.