I'm using KaTeX to display equations in my website. But I have some long equations and they flow out the screen. I tried adding
.katex-display > .katex { white-space: normal }
/* Add space between broken lines: */
.katex-display > .base { margin: 0.25em 0 }
/* Compensate by reducing space around display math */
.katex-display { margin: 0.5em 0; }
which is mentioned in the document, but it didn't work for me. I also tried adding
.katex-display { max-width: 90%; }
but it doesn't solve my problem.