电脑爱好者,提供IT资讯信息及各类编程知识文章介绍,欢迎大家来本站学习电脑知识。 最近更新 | 联系我们 RSS订阅本站最新文章
电脑爱好者
站内搜索: 
当前位置:首页>> HTML>>XHTML空的元素也必须关闭:

XHTML空的元素也必须关闭

来源:网络 | 2008-10-17 | (有4612人读过)

Empty elements must either have an end tag or the start tag must end with />. 
空的元素也必须有一个结束标签或者开始标签用/>结束。  

This is wrong: 
这是错误的:  

This is a break<br> 
Here comes a horizontal rule:<hr> 
Here’’s an image <img src="happy.gif" alt="Happy face"> 

This is correct: 
这是正确的: 

This is a break<br /> 

Here comes a horizontal rule:<hr /> 
Here’’s an image <img src="happy.gif" alt="Happy face" /> 

IMPORTANT Compatibility Note:  
注意兼容性的关键:   
To make your XHTML compatible with today’’s browsers, you should
 add an extra space before the "/" symbol like this: <br  />, and this: <hr  />.  
为了使你的XHTML能够兼容现在的浏览器,你必须在/符号之前加一个特殊的空格,就像这样:<br  />和这样:<hr  /> 
HTML热门文章排行
网站赞助商
购买此位置

 

关于我们 | 网站地图 | 文档一览 | 友情链接| 联系我们

Copyright © 2003-2024 电脑爱好者 版权所有 备案号:鲁ICP备09059398号