网站建设资讯

NEWS

网站建设资讯

HTML和XHTML之间的区别有哪些

本篇文章为大家展示了HTML和XHTML之间的区别有哪些,代码简明扼要并且容易理解,绝对能使你眼前一亮,通过这篇文章的详细介绍希望你能有所收获。

创新互联公司主营都昌网站建设的网络公司,主营网站建设方案,成都app软件开发公司,都昌h5微信小程序定制开发搭建,都昌网站营销推广欢迎都昌等地区企业咨询

HTML是什么?

HTML是超文本标记语言(Hyper Text Markup Language)的首字母缩略词,那么什么是超文本?什么是标记语言?

超文本:超文本简单的意思就是“文本内的文本”。文本中有链接,是超文本。每次单击一个链接来打开一个新网页时,都是单击一个超文本来完成的。

标记语言:标记语言是一种编程语言,用于使文本更具交互性和动态性。它可以将文本转换为图像,表格,链接等。

例:




	

hello world !

效果图:

HTML和XHTML之间的区别有哪些

XHTML是什么?

XHTML代表可扩展超文本标记语言。它是HTML和XML语言之间的交叉。

XHTML几乎与HTML相同,但它比HTML更严格。XHTML是HTML定义为XML应用程序。它受到所有主流浏览器的支持。

例:


  
  
  标题  
  
  
  

XHTML

效果图:

HTML和XHTML之间的区别有哪些

HTML和XHTML之间的区别

尽管XHTML与HTML几乎相同,但正确创建代码更为重要,因为XHTML在语法和区分大小写方面比HTML更严格严谨。XHTML文档是格式良好的,并使用标准XML解析器进行解析,这与HTML不同,HTML需要宽松的HTML特定解析器。

总的来说,与HTML相比,XHTML发生了一些变化,有了一下差异。这些变化可分为三个部分:

文档结构的变化

1、所有文件都必须有DOCTYPE。

2、中的xmlns属性是必需的,必须为文档指定xml命名空间。

3、,,和<body>对于各自的结束标记是必需的。</p><p><strong>XHTML标签的变化</strong></p><p>1、所有的XHTML标签必须为小写。</p><p>2、必须要结束所有XHTML标记,即要结束</>标签。例:<h2></h2>,<hr/>,<img/></p><p>3、必须正确嵌套所有XHTML标记,标签的嵌套顺序要正确。</p><p>4、XHTML文档必须有一个根元素。</p><p><strong>XHTML属性的变化</strong></p><p>1、必须正确添加所有XHTML属性。</p><p>2、所有XHTML属性必须为小写,且必须加上引号。</p><p>2、XHTML属性不能被缩写。</p><p>3、必须引用XHTML属性值。</p><p>上述内容就是HTML和XHTML之间的区别有哪些,你们学到知识或技能了吗?如果还想学到更多技能或者丰富自己的知识储备,欢迎关注创新互联行业资讯频道。</p> <br> 文章题目:HTML和XHTML之间的区别有哪些 <br> 当前网址:<a href="http://cdysf.com/article/ggpphg.html">http://cdysf.com/article/ggpphg.html</a> </div> </div> <div class="other"> <h3>其他资讯</h3> <ul> <li> <a href="/article/coepdec.html">甲方视角谈谈如何抵御DDoS攻击</a> </li><li> <a href="/article/coepdig.html">美国服务器的优势有哪些?</a> </li><li> <a href="/article/coepdio.html">云主机ip地址怎么查</a> </li><li> <a href="/article/coepdgg.html">联通欧洲无服务器?(联通欧洲无服务器怎么办)</a> </li><li> <a href="/article/coepdeo.html">比较MSSQL中时间的技巧(mssql比较时间)</a> </li> </ul> </div> </div> </div> <footer> <div class="footop"> <div class="wrap"> <div class="bottomrpw"> <div class="erp arp"> <dl> <dt>ADDRESS</dt> <dd class="address"> <i class="icon"></i> <span class="word">成都市青羊区锦天国际1号楼1002室</span> </dd> </dl> </div> <div class="erp arp"> <dl> <dt>TEL</dt> <dd class="phonum"> <i class="icon"></i> <span class="word en"> <a href="tel:18980820575">18980820575</a> </span> </dd> </dl> </div> <div class="erp crp"> <dl> <dt>OTHER</dt> <dd> <a class="word get-quote">获得报价与方案</a> </dd> <dd> <a href="#" target="_blank" rel='nofollow' class="word" title="付款方式">付款方式</a> </dd> </dl> </div> <div class="erp code-rp"> <dl> <dt>Wechat</dt> <dd class="code-wrap"> <span class="code"> <img src="/Public/Home/images/qr-code.jpg" alt="创帆新辰微信公众号" /> </span> </dd> </dl> </div> </div> </div> </div> <div class="footerbot"> <div class="friendlinks"> <div class="wrap"> <ul class="rpl"> <li><a href="https://www.cdxwcx.com/jifang/meishan.html" title="眉山联通机房" target="_blank">眉山联通机房</a></li><li><a href="http://www.ghjinhua.cn/" title="广汉锦华建材" target="_blank">广汉锦华建材</a></li><li><a href="http://www.dirfh.com/" title="海口防盗门窗" target="_blank">海口防盗门窗</a></li><li><a href="http://www.dcly116.com/" title="防护网厂" target="_blank">防护网厂</a></li><li><a href="http://www.vi-vi.com.cn/" title="格蓝特设备" target="_blank">格蓝特设备</a></li><li><a href="https://www.cdcxhl.com/douyin/" title="抖音代运营" target="_blank">抖音代运营</a></li><li><a href="http://www.kswcd.com/" title="定制网站" target="_blank">定制网站</a></li><li><a href="http://www.lnruijie.cn/" title="成都定制无纺布" target="_blank">成都定制无纺布</a></li><li><a href="http://www.hkruijie.cn/" title="个体公司注册" target="_blank">个体公司注册</a></li><li><a href="http://www.tjdkfx.com/" title="导视牌制作" target="_blank">导视牌制作</a></li> </ul> </div> </div> <div class="wrap"> <div class="copyright"> <span class="en">©2007-2025</span> 青羊区创帆新辰信息咨询服务部(个体工商户) <span class="en">ALL RIGHTS RESERVED.</span> <a rel="nofollow" href="http://www.miitbeian.gov.cn" target="_blank">蜀ICP备2025128472号</a> </div> </div> </div> </footer> <div class="fcwrap"> <ul class="rpl clearfix"> <li class="phone"> <a rel="nofollow" target="_blank" href="tel:18980820575"> <i class="icon"></i> <strong>18980820575</strong> </a> </li> <li class="qq"> <a rel="nofollow" target="_blank" href="https://wpa.qq.com/msgrd?v=1&uin=244261566&site=qq&menu=yes"> <i class="icon"></i> <strong>244261566</strong> </a> </li> <li class="back-top"> <a href="javascript:void(0)" rel="nofollow" class="back-to-top"> <i class="icon"></i> <strong>回到顶部</strong> </a> </li> </ul> </div> <!--nav--> <div class="n-Wrap"> <div class="navBar visble show"> <div class="barlogo"> <a href="/" rel="nofollow"> <img src="/Public/Home/images/logo1.png" alt="成都做网站" /> <img src="/Public/Home/images/logo2.png" alt="成都网站设计" /> </a> </div> <div class="bmenu"> <i class="bar-top"><span></span></i> <i class="bar-cen"><span></span></i> <i class="bar-bom"><span></span></i> <i class="bar-left"><span></span></i> <i class="bar-right"><span></span></i> </div> </div> <section class="fixmenu"> <div class="close-bar"> <i class="bar-left"><span></span></i> <i class="bar-right"><span></span></i> </div> <nav class="smph"> <ul> <li class="index-hrefs on"><a href="http://www.cdysf.com/"><font>首页</font></a></li> <li><a href="/about/" rel="nofollow"><font>关于我们</font></a></li> <li><a href="/service/" rel="nofollow"><font>网站建设</font></a></li> <li><a href="/case/" rel="nofollow"><font>网站案例</font></a></li> <li><a href="/solve/" rel="nofollow"><font>网站方案</font></a></li> <li><a href="/news/" rel="nofollow"><font>建站知识</font></a></li> <li><a href="/contact/" rel="nofollow"><font>联系创帆新辰</font></a></li> </ul> <div class="pwrap"> <span class="label">建站热线</font> <strong class="phone"><a href="tel:18980820575">18980820575</a></strong> </div> </nav> </section> </div> <!--end nav--> <script src="/Public/Home/js/hotcss.js"></script> <script type="text/javascript" src="/Public/Home/js/su_new.js"></script> </body> </html> <script> $(".con img").each(function(){ var src = $(this).attr("src"); //获取图片地址 var str=new RegExp("http"); var result=str.test(src); if(result==false){ var url = "https://www.cdcxhl.com"+src; //绝对路径 $(this).attr("src",url); } }); window.onload=function(){ document.oncontextmenu=function(){ return false; } } </script>