html页面中的标签结构为什么要扁平化?

html页面中的标签结构为什么要扁平化?,第1张

主要是有三方面的优势:

搜索引擎友好,如果结构太深的话,不便于抓取,不利于seo蜘蛛对于网站结构的理解,从而影响收录或者排名;

代码的可维护度,如果太深的话,由于是多人开发,不便于同事读懂代码;

用js或jquery在 *** 作dom的时候,方便理解和元素选取。

以上就是html页面中最好用扁平化的原因。

<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title>无标题文档</title>

<style>

  .dow{display:blockwidth:202pxheight:52px line-height:52px text-align:center font-family:arial,verdana,sans-serif, '新宋体' font-weight:bold font-size:22px background:#428bcacolor:#fff text-decoration:none border: 3px solid #357ebd cursor:pointer}

  .dow:hover{background:#1165ae}

  .dow:active{background:#0d79d5}

</style>

</head>

<body>

   <input name="xiazai" type="submit" class="dow" value="立即下载">

   <br />

   <br/>

   <button name="xiazai" type="submit" class="dow">立即下载</button>

   <br />

   <br />

   <a href="#" class="dow">立即下载</a>

</body>

</html>

效果图:


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/6262128.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-03-19
下一篇 2023-03-19

发表评论

登录后才能评论

评论列表(0条)

保存