Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the failure of html tags

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces the html tag failure how to solve the relevant knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe that we read this html tag failure how to solve the article will have a harvest, let's take a look at it.

Solution: 1. Assign the innerText of the element to the innerHTML;2 of the element, similar to the line feed of carriage return, and use the "word-break:break-all;word-wrap:break-word;white-space:pre-line;" style to render.

The operating environment of this tutorial: windows7 system, CSS3&&HTML5 version, Dell G3 computer.

1) assign the element's innerText to the element's innerHTML. The problem of escape can be avoided and the HTML tags contained in the string will take effect.

{{intro}} mounted () {/ / let text = this.$refs.introContent.innerText; / / this.$ refs.introContent [XSS _ clean] = text;}

2) it is similar to the line feeds like enter, and the line feeds are presented in style.

Word-break: break-all;word-wrap: break-word;white-space: pre-line; this article on "how to solve the problem of html tag failure" is introduced here, thank you for reading! I believe that everyone has a certain understanding of the knowledge of "how to solve the failure of html tags". If you want to learn more knowledge, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report