html 中<br>和<br/>
来源:互联网 发布:汉文化复兴 知乎 编辑:程序博客网 时间:2024/05/16 08:06
answer from stackflow:
Simply <br>
is sufficient.
The other forms are there for compatibility with XHTML; to make it possible to write the same code as XHTML, and have it also work as HTML. Some systems that generate HTML may be based on XML generators, and thus not have the ability to output just a bare <br>
tag; if you're using such a system, it's fine to use <br/>
, it's just not necessary if you don't need to do it.
Very few people actually use XHTML, however. You need to serve your content asapplication/xhtml+xml
for it to be interpreted as XHTML, and that will not work in IE (it will also mean that any small error you make will prevent your page from being displayed, in browsers that do support XHTML). So, most of what looks like XHTML on the web is actually being served, and interpreted, as HTML. See Serving XHTML as text/html Considered Harmful for some more information.
意思就是说:HTML中的规定是<br>空标签,没有结束符,但是在XHTML中,规定是<br/>开始标签后面紧跟结束标签。
在 XHTML 中,<br> 标签必须被正确地关闭,比如这样:<br />。<br> 标签是空标签(意味着它没有结束标签,因此这是错误的:<br></br>)。在 XHTML 中,把结束标签放在开始标签中,也就是 <br />。
- html 中<br>和<br/>
- HTML中<br/>和<br>的使用问题
- html中,<br><br/><br />三者的区别?
- <html>p和br
- html<br> 还是 <br />
- HTML 标签 <br> <br />
- html中<li></li>中使用<br>和<li></li>外面使用<br>
- br
- JSP(HTML)中((br/))的应用
- HTML 之 <br> 标签
- html \n -> <br/>
- <html>p、br
- HTML <br>换行标签
- <br>和javascript中\n的区别
- python xpath 提取html 中使用<br>分割的文本
- <html>h1~h6、body、br
- HTML标记【标记br和p的使用】!
- HTML标签<br><br/>的区别在哪里?
- 【笔面大全】卡特兰数 Catalan
- Ubuntu下远程访问MySQL数据库
- C++之自定义的output缓冲区
- poj1088
- Windows 7 虚拟串口 VSPD 支持64bit
- html 中<br>和<br/>
- 外国网站
- 为Android交叉编译busybox
- Android-解决AutoCompleteText下拉提示的字体颜色是白色的问题
- wp-主题资源
- 给定一个8*8的方格子,A点到B点的最短路径有多少条?
- 编译可在Android上运行的可执行文件:C/C++交叉编译环境
- 【VC编程技巧】文件☞2.2文件读写缓存机制和换行符(\r\n)
- wampserver下配置虚拟主机 实现多站点支持(测试通过WIN7 64)