. This writing method is also the so-called self-closing method, which is completely legal in XML. If you are familiar with XML-related development, you may be accustomed to this way of writing. Think of it as any element in XML that does not contain child nodes can be written in this way, so tags without content in XHTML can also be written in this way."/> . This writing method is also the so-called self-closing method, which is completely legal in XML. If you are familiar with XML-related development, you may be accustomed to this way of writing. Think of it as any element in XML that does not contain child nodes can be written in this way, so tags without content in XHTML can also be written in this way.">
search
HomeWeb Front-endHTML TutorialIssues that should be paid attention to when writing self-closing XHTML tags_HTML/Xhtml_Web page production


The img tag in XHTML should be written like this: . This writing method is also the so-called self-closing method, which is completely legal in XML. If you are familiar with XML-related development, you may be accustomed to this way of writing. Thinking that any element in XML that does not contain child nodes can be written in this way, then tags without content in XHTML can also be written in this way. XHTML theoretically allows any tag to be written in a self-closing method. However, browser compatibility has brought new problems, that is, IE cannot correctly recognize the self-closing writing method of some tags. String 8
Please try to enter the following XHTML code and browse it in IE:

hello world

. You will find that you can only see the hello in the front but not the world in the back. This is quite inexplicable. Yes. There may be many people who have encountered this problem and spent several hours on it but still can't find a reasonable explanation. String 4
The explanation comes from another similar piece of code:

hello world

. Can you see the display effect in IE and get a reasonable explanation? We can see that the hello in the front is displayed normally, while the world in the back is displayed in the textarea. This proves that IE does not correctly recognize that the textarea tag has closed itself. Instead, it treats the following content as a textarea when it is not closed. internal content.
At this time we understand why the previous code cannot see the world behind it, because it is recognized as part of the script. This shows that when we use XHTML, we cannot use self-closing writing as freely as XML. Only a few tags that do not need to be closed can be written in self-closing. Other tags are best used in pairs even if they do not have any content. closed writing method.
Finally, I need to remind everyone that in fact, IE is not the only one with weak parsers. In many places, you may encounter problems caused by loose parsers. Therefore, when writing XHTML, we still have to accommodate some inheritance from old HTML. Habit, you can't just write it casually like real XML because you think it meets the standards. Don’t believe it? Then try another one:

hello
world

, pay attention to the display effect in IE and Opera.
Some related specifications of XHTML:
1. All tags must have a corresponding closing tag
2. The names of all tag elements and attributes must be in lowercase
3. All XML tags must be reasonably nested
4. All attributes must be enclosed in quotation marks ""
5. Encode all 6. Give all Assign a value to the attribute
7. Do not use “--” in the comment content
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
如何解决 VS Code 中 IntelliSense 不起作用的问题如何解决 VS Code 中 IntelliSense 不起作用的问题Apr 21, 2023 pm 07:31 PM

最常称为VSCode的VisualStudioCode是开发人员用于编码的工具之一。Intellisense是VSCode中包含的一项功能,可让编码人员的生活变得轻松。它提供了编写代码的建议或工具提示。这是开发人员更喜欢的一种扩展。当IntelliSense不起作用时,习惯了它的人会发现很难编码。你是其中之一吗?如果是这样,请通过本文找到不同的解决方案来解决IntelliSense在VS代码中不起作用的问题。Intellisense如下所示。它在您编码时提供建议。首先检

解决C++代码中出现的“error: redefinition of class 'ClassName'”问题解决C++代码中出现的“error: redefinition of class 'ClassName'”问题Aug 25, 2023 pm 06:01 PM

解决C++代码中出现的“error:redefinitionofclass'ClassName'”问题在C++编程中,我们经常会遇到各种各样的编译错误。其中一个常见的错误是“error:redefinitionofclass'ClassName'”(类‘ClassName’的重定义错误)。这个错误通常出现在同一个类被定义了多次的情况下。本文将

MySQL中.ibd文件的作用详解及相关注意事项MySQL中.ibd文件的作用详解及相关注意事项Mar 15, 2024 am 08:00 AM

MySQL中.ibd文件的作用详解及相关注意事项MySQL是一种流行的关系型数据库管理系统,数据库中的数据存储在不同的文件中。其中,.ibd文件是InnoDB存储引擎中的数据文件,用于存储表中的数据和索引。本文将对MySQL中.ibd文件的作用进行详细解析,并提供相关代码示例以帮助读者更好地理解。一、.ibd文件的作用:存储数据:.ibd文件是InnoDB存

解决PHP报错:继承父类时遇到的问题解决PHP报错:继承父类时遇到的问题Aug 17, 2023 pm 01:33 PM

解决PHP报错:继承父类时遇到的问题在PHP中,继承是一种重要的面向对象编程的特性。通过继承,我们能够重用已有的代码,并且能够在不修改原有代码的情况下,对其进行扩展和改进。尽管继承在开发中应用广泛,但有时候在继承父类时可能会遇到一些报错问题,本文将围绕解决继承父类时遇到的常见问题进行讨论,并提供相应的代码示例。问题一:未找到父类在继承父类的过程中,如果系统无

win10下载不了steam怎么办win10下载不了steam怎么办Jul 07, 2023 pm 01:37 PM

Steam是十分受欢迎的一个平台游戏,拥有众多优质游戏,可是有些win10用户体现自己下载不了steam,这是怎么回事呢?极有可能是用户的ipv4服务器地址没有设置好。要想解决这个问题的话,你可以试着在兼容模式下安装Steam,随后手动修改一下DNS服务器,将其改成114.114.114.114,以后应当就能下载了。win10下载不了steam怎么办:WIn10下能够试着兼容模式下安装,更新后必须关掉兼容模式,不然网页将无法加载。点击程序安装的属性,以兼容模式运作运行这个程序。重启以增加内存,电

机器学习模型的泛化能力问题机器学习模型的泛化能力问题Oct 08, 2023 am 10:46 AM

机器学习模型的泛化能力问题,需要具体代码示例随着机器学习的发展和应用越来越广泛,人们越来越关注机器学习模型的泛化能力问题。泛化能力指的是机器学习模型对未标记数据的预测能力,也可以理解为模型在真实世界中的适应能力。一个好的机器学习模型应该具有较高的泛化能力,能够对新的数据做出准确的预测。然而,在实际应用中,我们经常会遇到模型在训练集上表现良好,但在测试集或真实

弱监督学习中的标签获取问题弱监督学习中的标签获取问题Oct 08, 2023 am 09:18 AM

弱监督学习中的标签获取问题,需要具体代码示例引言:弱监督学习是一种利用弱标签进行训练的机器学习方法。与传统的监督学习不同,弱监督学习只需利用较少的标签来训练模型,而不是每个样本都需要有准确的标签。然而,在弱监督学习中,如何从弱标签中准确地获取有用的信息是一个关键问题。本文将介绍弱监督学习中的标签获取问题,并给出具体的代码示例。弱监督学习中的标签获取问题简介:

强化学习中的奖励设计问题强化学习中的奖励设计问题Oct 08, 2023 pm 01:09 PM

强化学习中的奖励设计问题,需要具体代码示例强化学习是一种机器学习的方法,其目标是通过与环境的交互来学习如何做出能够最大化累积奖励的行动。在强化学习中,奖励起着至关重要的作用,它是代理人(Agent)学习过程中的信号,用于指导其行为。然而,奖励设计是一个具有挑战性的问题,合理的奖励设计可以极大地影响到强化学习算法的性能。在强化学习中,奖励可以被视为代理人与环境

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

mPDF

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),

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software