tag
Problem scenario:
I clicked a request on page A, opened a new page (B), and passed HttpServlet on the backend Response.getWriter().write(html) method is used to write the information into the newly opened page B; [Digression: The reason for this is to solve the problem of the newly opened page being intercepted by the browser]
But there is no problem in IE6, 7, 8, ff; but in chrome, my newly written content is actually placed in the
tag; <p><img src="/static/imghwm/default1.png" data-src="https://img.php.cn/upload/article/000/000/194/2dca1e20198ed7fa37b2e8461817f576-0.jpg?x-oss-process=image/resize,p_40" class="lazy" alt="Detailed explanation of html browser automatically adding <pre class="brush:php;toolbar:false"> tag"><br></p><p><strong>About html <pre class="brush:php;toolbar:false"> tag: <excerpted from: w3school></excerpted>
pre element can define pre-formatting ized text. Text enclosed in a pre element usually preserves whitespace and newlines. The text will also be rendered in a fixed-width font.
A common application of tags is to represent computer source code. <p style="margin-top:12px; margin-bottom:0px; line-height:18px; font-family:Verdana,Arial,Helvetica,sans-serif"><strong> Thoughts on the problem: </strong></p><p style="margin-top:12px; margin-bottom:0px; line-height:18px; font-family:Verdana,Arial,Helvetica,sans-serif">After discovering this problem, the first thing I thought of was: This should be because different browsers process code text information differently, chrome My form is displayed on the page as text. And <span style="color:#ff0000"> is not an element in html format; so I think everything should be fine once this problem is solved. </span></p><p style="margin-top:12px; margin-bottom:0px; line-height:18px"><span style="font-family:Verdana,Arial,Helvetica,sans-serif">At this time, I thought of the setting of html</span><span style="font-family:微软雅黑,Verdana,sans-serif,宋体"><span style="font-size:14px">meta information</span></span></p><p style="margin-top:12px; margin-bottom:0px; line-height:18px; font-family:Verdana,Arial,Helvetica,sans-serif"><span style="font-family:微软雅黑,Verdana,sans-serif,宋体; font-size:14px"><span style="font-family:Tahoma; line-height:18px"> <meta http-equiv="<span style=" color:>Content-Type</span>" content="</span><span style="font-family:Tahoma; line-height:18px"><span style="color:#ff0000">text/html</span></span><span style="font-family:Tahoma; line-height:18px"> ;char<a href="http://www.php.cn/code/8209.html" target="_blank">set</a>=utf-8" /> Setting this <a href="http://www.php.cn/wiki/169.html" target="_blank">attribute</a> should solve the problem. </span><br></p><p style="margin-top:12px; margin-bottom:0px; line-height:18px; font-family:Verdana,Arial,Helvetica,sans-serif"><span style="font-family:微软雅黑,Verdana,sans-serif,宋体; font-size:14px"><span style="font-family:Tahoma; line-height:18px; background-color:rgb(255,255,255)">After checking the document, it suddenly became clear: </span></span></p><p style="margin-top:12px; margin-bottom:0px; line-height:18px; font-family:Verdana,Arial,Helvetica,sans-serif"><span style="font-family:微软雅黑,Verdana,sans-serif,宋体; font-size:14px"><span style="font-family:Tahoma; line-height:18px"></span></span></p><p style="padding-top:0px; padding-bottom:0px; margin-top:0px; margin-bottom:10px; font-family:微软雅黑,Verdana,sans-serif,宋体; font-size:14px"><span style="padding:0px; margin:0px; color:rgb(229,51,51)"><span style="padding:0px; margin:0px; color:rgb(0,0,0); background-color:rgb(255,255,255)">1. text/html is the text in html format </span></span></p><p style="padding-top:0px; padding-bottom:0px; margin-top:0px; margin-bottom:10px; font-family:微软雅黑,Verdana,sans-serif,宋体; font-size:14px"><span style="padding:0px; margin:0px; color:rgb(229,51,51)"><span style="padding:0px; margin:0px; color:rgb(0,0,0); background-color:rgb(255,255,255)">2. text/plain is unformatted Text</span></span></p><p style="padding-top:0px; padding-bottom:0px; margin-top:0px; margin-bottom:10px; font-family:微软雅黑,Verdana,sans-serif,宋体; font-size:14px">3. text/xml ignores the encoding format specified by the xml header and defaults to us-ascii encoding</p><p style="padding-top:0px; padding-bottom:0px; margin-top:0px; margin-bottom:10px; font-family:微软雅黑,Verdana,sans-serif,宋体; font-size:14px"><span style="padding:0px; margin:0px; color:rgb(229,51,51)"><span style="padding:0px; margin:0px; color:rgb(0,0,0); background-color:rgb(255,255,255)">4. application/xml will Encode according to the encoding format specified by the xml header </span></span></p><p><strong> Solution: </strong></p><p style="margin-top:12px; margin-bottom:0px; line-height:18px; font-family:Verdana,Arial,Helvetica,sans-serif"><span style="font-family:微软雅黑,Verdana,sans-serif,宋体; font-size:14px"><span style="font-family:Tahoma; line-height:18px"></span></span></p><pre class='brush:php;toolbar:false;'>response.setHeader("Content-Type", "text/html");
The above is the detailed content of Detailed explanation of html browser automatically adding
tag. For more information, please follow other related articles on the PHP Chinese website!

本篇文章带大家了解一下HTML(超文本标记语言),介绍一下HTML的本质,HTML文档的结构、HTML文档的基本标签和图像标签、列表、表格标签、媒体元素、表单,希望对大家有所帮助!

要在UbuntuLinux中删除FirefoxSnap,可以按照以下步骤进行操作:打开终端并以管理员身份登录到Ubuntu系统。运行以下命令以卸载FirefoxSnap:sudosnapremovefirefox系统将提示你输入管理员密码。输入密码并按下Enter键以确认。等待命令执行完成。一旦完成,FirefoxSnap将被完全删除。请注意,这将删除通过Snap包管理器安装的Firefox版本。如果你通过其他方式(如APT包管理器)安装了另一个版本的Firefox,则不会受到影响。通过以上步骤

总结了一些web前端面试(笔试)题分享给大家,本篇文章就先给大家分享HTML部分的笔试题(附答案),大家可以自己做做,看看能答对几个!

mozilla firefox可以卸载;firefox属于第三方浏览器,如果不需要,完全可以卸载。卸载方法:1、在开始菜单中,依次点击“Windwos系统”-“控制面板”;2、在“控制面板”界面中,点击“程序和功能”;3、在新界面中,找到并双击火狐浏览器图标;4、在卸载弹窗中,点击“下一步”;5、点击“卸载”即可。

近日消息,Mozilla在发布Firefox112稳定版的同时,也宣布下个主要版本Firefox113进入Beta频道,支持AV1动图、增强密码生成器和画中画特性。火狐浏览器Firefox113主要新功能/新特性如下支持AV1格式动图(AVIS)通过引入特殊字符来增强密码生成器的安全性增强画中画功能,支持后退、显示视频时间,能更轻松地启用全屏模式为Debian和Ubuntu发行版提供官方DEB安装文件更新书签导入功能,默认情况下支持导入书签的图标在支持的硬件上默认启用硬件加速AV1视频解码使用w

HTML5中画布标签是“<canvas>”。canvas标签用于图形的绘制,它只是一个矩形的图形容器,绘制图形必须通过脚本(通常是JavaScript)来完成;开发者可利用多种js方法来在canvas中绘制路径、盒、圆、字符以及添加图像等。

对于爬虫爬取需要登录的网站,验证码或扫码登录是一个很困扰的问题。Scrapy是Python中一个非常好用的爬虫框架,但是在处理验证码或扫码登录时,需要采取一些特殊的措施。作为一个常见的浏览器,MozillaFirefox提供了一种解决方案,可以帮助我们解决这个问题。Scrapy的核心模块是twisted,它只支持异步请求,但是一些网站需要使用cookie和


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Linux new version
SublimeText3 Linux latest version

Notepad++7.3.1
Easy-to-use and free code editor

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Dreamweaver CS6
Visual web development tools
