A
A
Andrew2020-05-08 15:20:14
css
Andrew, 2020-05-08 15:20:14

How to prevent global styles from being overridden by styles from v-html?

Hey!
I'm working on displaying messages from ebay. They come as html, which I put in the v-html directive.

Some of them contain styles that conflict with the global ones - either padding will appear on the body, or some kind of margin. From some letters, the whole layout can break down. I have not come across this before, and if I output html, then it is "checked". There is also no way to sanitize the received data, you need to display it as it is. But how can content be encapsulated?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2020-05-08
@AndrewRusinas

<iframe :srcdoc="htmlContent"></iframe>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question