Home >Web Front-end >JS Tutorial >Solution to style problem when browser parses html generated by js_javascript skills
The function I implemented is to add tags to the end of the tag list without refreshing. See the second line in the picture below. There is obviously something wrong with the style
I repeatedly checked the html of the chrome console The structures are all the same. I have carefully compared them in IE and FF, and there is still no difference. See the picture below
The same html structure, the same style, but the displayed styles are very different. I ran out of ideas for a while, like a headless fly. I simply copied the html under the console to notepad for comparison, and I saw some clues, as shown in the picture below. The left side is the html generated by js, and the right side is the html in the page (.aspx)
The reason for the style difference may be the lack of line breaks on the left side. I put the characters in each line Newline character added at the end"
”, so the style problem is solved