资讯专栏INFORMATION COLUMN

HTML基础知识

leeon / 2736人阅读

摘要:标签用于定义文档的头部,它是所有头部元素的容器。头部元素有等标签。遵循的原则是先确定语义的,再选合适的。并且依据重要性递减。锚点定位难点通过创建锚点链接,用户能够快速定位到目标内容。

1 什么是HTML?

HTML 指的是超文本标记语言 (Hyper Text Markup Language)。
不是一种编程语言,而是一种标记语言,标记语言是一套标记标签,HTML 使用标记标签来描述网页。

2 HTML标签

HTML 标签是由尖括号包围的关键词,比如 ; 标签通常是成对出现的,标签对中的第一个标签是开始标签,第二个标签是结束标签。
标签分类:

双标签

html<标签名> 内容

单标签(也称为空标签)

hr<标签名 />

标签关系分为两种:

嵌套关系

     
               
    

并列关系

      
      
3 HTML基本结构
如下所示:


    
    Document

...


代码讲解:
1. 称为根标签,所有的网页标签都在中。
2.  标签用于定义文档的头部,它是所有头部元素的容器。
头部元素有、<script>、 <style>、<link>、 <meta>等标签。
3. 在<body>和</body>标签之间的内容是网页的主要内容,如<h1>、<p>、<a>、
</head></pre>
<b><strong>4 标签语义化</strong></b>
<p>所谓标签语义化,就是指标签的含义。   <br><strong>为什么要有语义化标签</strong></p>

<p>方便代码的阅读和维护。</p>
<p>同时让浏览器或是网络爬虫可以很好地解析,从而更好分析其中的内容 。</p>
<p>使用语义化标签会具有更好地搜索引擎优化。</p>

<p>语义是否良好,在于当我们去掉CSS之后,网页结构依然阻止有序,并且有良好的可续性。<br>也就是说,一眼看去知道哪个是重点结构是什么,知道每一块的内容有什么作用。<br>遵循的原则是先确定语义的HTML,再选合适的CSS。</p>
<b><strong>5 段落标签</strong></b>
<pre><p>段落 </p>
<p>标签的默认样式,段前段后都会有空白。</pre>
<b><strong>6 换行标签</strong></b>
<pre>如果希望在不产生一个新段落的情况下进行换行(新行),请使用 <br /> 标签:
<p>Helloween<br/>World!<br/>I"m Coming!</p></pre>
<b><strong>7 标题标签</strong></b>
<p>标题标签一共有6个,h1、h2、h3、h4、h5、h6分别为一级标题、二级标题、三级标题、四级标题、五级标题、六级标题。<br>并且依据重要性递减。<h1>是最高的等级。</p>
<pre>语法: <hx>标题文本</hx> (x为1-6)</pre>
<p>标题标签的样式都会加粗,h1标签字号最大,h2标签字号相对h1要小,以此类推h6标签的字号最小。<br>一个标题标签要独占一整行。</p>
<b><strong>8 水平线标签</strong></b>
<pre><hr /> 标签在 HTML 页面中创建水平线,可用于分隔内容。
<p>Welcome to China!</p>
<hr/> 是单标签
<p>Thank you!</p></pre>
<b><strong>9 注释</strong></b>
<p>注释的作用是为了解释代码的用途,方便程序员查找以及他人阅读。常见的注释有:</p>
<pre><!--注释-->     
/*注释*/
可以使用快捷键  ctrl+/ 或者 ctrl+shift+/</pre>
<b><strong>10 div span标签</strong></b>
<p>div span没有语义,它的作用是为了结合CSS设置多带带的样式使用。</p>
<pre>语法:
    <div>分割</div>
    <span>跨度</span></pre>
<b><strong>11 列表</strong></b>
<p>列表分为无序列表、有序列表和自定义列表</p>
<p>无序列表:使用ul-li标签实现,没有前后顺序的信息列表。</p>
<pre>语法:
    <ul>
        <li>1</li>
        <li>2</li>
        <li>3</li>
        ...
    </ul></pre>
<p>有序列表:使用ol-li标签实现,是有前后顺序的信息列表。</p>
<pre>语法:
    <ol>
        <li>6</li>
        <li>5</li>
        <li>4</li>
        ...
    </ol></pre>
<p>自定义列表:使用dl-dt-dd标签实现,通常用于对术语或名词进行解释和描述,自定义列表的列表项前没有任何项目符号。</p>
<pre>语法:
    <dl>
        <dt></dt>
        <dd></dd>
        <dd></dd>
        ...
        <dt></dt>
        <dd></dd>
        <dd></dd>
        ...
    </dl></pre>
<b><strong>12 表格</strong></b>
<p>创建表格几元素:table(定义表格)、tr(行)、td(列)、thread(表格头部)、th(表格表头)、tbody(表格主体)<br>除此之后还有<caption>指定表格标题,rowspan合并行,colspan合并列。</p>
<pre>语法:
    <table>
        <caption>标题</caption>
        <tr>第一行<td>第一列</td><td colspan="2">跨两列</td><td></td></tr>
        <tr>第二行<td>第二列</td><td></td><td></td></tr>
    </table></pre>
<b><strong>13 超链接</strong></b>
<p>超链接类型分为三种:1 内部链接 2 外部链接 3 锚链接</p>
<pre>    <a href="跳转目标" target="目标窗口的弹出方式" title="鼠标滑过显示的文本">链接显示的文本</a></pre>
<p>href:用于指定链接目标的url地址,当为标签应用href属性时,它就具有了超链接的功能。 <br>Hypertext Reference的缩写。意思是超文本引用<br>target:用于指定链接页面的打开方式,其取值有_self和_blank两种,其中_self为默认值,_blank为在新窗口中打开方式。</p>
<p><strong>注意</strong>:</p>

<p>外部链接 需要添加 http:// www.baidu.com</p>
<p>内部链接 直接链接内部页面名称即可 比如 < a href="index.html"> 首页 </p>
<p>如果当时没有确定链接目标时,通常将链接标签的href属性值定义为“#”(即href="#"),表示该链接暂时为一个空链接。</p>
<p>不仅可以创建文本超链接,在网页中各种网页元素,如图像、表格、音频、视频等都可以添加超链接。</p>

<p>锚点定位 (难点)<br>通过创建锚点链接,用户能够快速定位到目标内容。创建锚点链接分为两步:</p>

<p>使用“a href=”#id名>“链接文本"创建链接文本(被点击的)<br>
</p>
<p>使用相应的id名标注跳转目标的位置。<br>跳转到锚链接
</p>

<b><strong>14 图片</strong></b>
<pre>语法:
    
</form>
当type="text"对应的就是文本输入框;当type="password",对应的就是密码输入框。</pre>
<p>复选框:</p>
<pre><input type="checkbox" value="值" name="名称" checked="checked"/> 比如个人资料填写爱好的勾选</pre>
<p>单选框:</p>
<pre><input type="radio" value="值" name="名称" checked="checked"/>  比如性别的选取</pre>
<p>多行文本框:</p>
<pre><textarea rows="行数" cols="列数">文本</textarea>  比如备注的填写</pre>
<p>下拉框:</p>
<pre><select>
    <option value="提交值" selected="selected">选项</option>
    <option value="提交值">选项</option>
    <option value="提交值">选项</option>
    ...
</select></pre>
<p>按钮:</p>
<pre>提交按钮 <input type="submit" value="提交">
重置按钮 <input type="reset" value="重置"/></pre>           
               
                                           
                       
                 </div>
            
                     <div class="mt-64 tags-seach" >
                 <div class="tags-info">
                                                                                                                    
                         <a style="width:120px;" title="混合云" href="https://www.ucloud.cn/site/product/uhybrid.html">混合云</a>
                                             
                         <a style="width:120px;" title="私有云" href="https://www.ucloud.cn/site/product/ucloudstack.html">私有云</a>
                                                                                                                                                 
                                      
                     
                    
                                                                                               <a style="width:120px;" title="html基础知识" href="https://www.ucloud.cn/yun/tag/htmljichuzhishi/">html基础知识</a>
                                                                                                           <a style="width:120px;" title="html是基础知识" href="https://www.ucloud.cn/yun/tag/htmlshijichuzhishi/">html是基础知识</a>
                                                                                                           <a style="width:120px;" title="html5基础知识" href="https://www.ucloud.cn/yun/tag/html5jichuzhishi/">html5基础知识</a>
                                                                                                           <a style="width:120px;" title="html基础" href="https://www.ucloud.cn/yun/tag/htmljichu/">html基础</a>
                                                         
                 </div>
               
              </div>
             
               <div class="entry-copyright mb-30">
                   <p class="mb-15"> 文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。</p>
                 
                   <p>转载请注明本文地址:https://www.ucloud.cn/yun/54012.html</p>
               </div>
                      
               <ul class="pre-next-page">
                 
                                  <li class="ellipsis"><a class="hpf" href="https://www.ucloud.cn/yun/54011.html">上一篇:重学前端学习笔记(二十九)--JavaScript中要不要加分号?</a></li>  
                                                
                                       <li class="ellipsis"><a class="hpf" href="https://www.ucloud.cn/yun/54013.html">下一篇:WebSocket 前后端实时消息推送</a></li>
                                  </ul>
              </div>
              <div class="about_topicone-mid">
                <h3 class="top-com-title mb-0"><span data-id="0">相关文章</span></h3>
                <ul class="com_white-left-mid atricle-list-box">
                             
                                                                    <li>
                                                <div class="atricle-list-right">
                          <h2 class="ellipsis2"><a class="hpf" href="https://www.ucloud.cn/yun/1293.html"><b>#WEB安全<em>基础</em> : <em>HTML</em>/CSS | 文章索引</b></a></h2>
                                                     <p class="ellipsis2 good">摘要:黑体本系列讲解安全所需要的和黑体安全基础我的第一个网页黑体安全基础初识黑体安全基础初识标签黑体安全基础文件夹管理网站黑体安全基础模块化黑体安全基础嵌套列表黑体安全基础标签拓展和属性的使用黑体安全基础嵌套本系列讲解WEB安全所需要的HTML和CSS

#WEB安全基础 : HTML/CSS | 0x0 我的第一个网页
#WEB安全基础 : HTML/CSS | 0x1初识CSS
#WEB安全基...</p>
                                                   
                          <div class="com_white-left-info">
                                <div class="com_white-left-infol">
                                    <a href="https://www.ucloud.cn/yun/u-1651.html"><img src="https://www.ucloud.cn/yun/data/avatar/000/00/16/small_000001651.jpg" alt=""><span class="layui-hide64">EscapedDog</span></a>
                                    <time datetime="">2019-04-23 11:53</time>
                                    <span><i class="fa fa-commenting"></i>评论0</span> 
                                    <span><i class="fa fa-star"></i>收藏0</span> 
                                </div>
                          </div>
                      </div>
                    </li> 
                                                                                       <li>
                                                <div class="atricle-list-right">
                          <h2 class="ellipsis2"><a class="hpf" href="https://www.ucloud.cn/yun/1169.html"><b><em>Html</em>和Css学习笔记-<em>html</em><em><em>基础</em><em>知识</em></em></b></a></h2>
                                                     <p class="ellipsis2 good">摘要:我的邮箱地址欢迎大家交流学习纠错此篇博客是我的复习笔记,和学的时间太久了,忘得差不多了,最近要使用一下,所以重新打开的书略读,后记录了标签,元素,属性的具体意义。有些标记有属性,具体格式,以标记为例,其中为标记的属性。我的邮箱地址:zytrenren@163.com欢迎大家交流学习纠错!
此篇博客是我的复习笔记,html和css学的时间太久了,忘得差不多了,最近要使用一下,所以重新打开htm...</p>
                                                   
                          <div class="com_white-left-info">
                                <div class="com_white-left-infol">
                                    <a href="https://www.ucloud.cn/yun/u-857.html"><img src="https://www.ucloud.cn/yun/data/avatar/000/00/08/small_000000857.jpg" alt=""><span class="layui-hide64">yzzz</span></a>
                                    <time datetime="">2019-04-23 11:47</time>
                                    <span><i class="fa fa-commenting"></i>评论0</span> 
                                    <span><i class="fa fa-star"></i>收藏0</span> 
                                </div>
                          </div>
                      </div>
                    </li> 
                                                                                       <li>
                                                <div class="atricle-list-right">
                          <h2 class="ellipsis2"><a class="hpf" href="https://www.ucloud.cn/yun/122442.html"><b>保姆级教程<em>HTML</em>两万字笔记大总结【建议收藏】(上篇)</b></a></h2>
                                                     <p class="ellipsis2 good">摘要:标签不区分大小写,但推荐小写。标签可以嵌套,但不能交叉嵌套。标签也称为元素。比如行内标签亦可成行内元素。                                                                                                                     ❤️HTML必备知识详解❤️ 第一部分:HTML框架简介...</p>
                                                   
                          <div class="com_white-left-info">
                                <div class="com_white-left-infol">
                                    <a href="https://www.ucloud.cn/yun/u-668.html"><img src="https://www.ucloud.cn/yun/data/avatar/000/00/06/small_000000668.jpg" alt=""><span class="layui-hide64">paulli3</span></a>
                                    <time datetime="">2021-10-13 09:40</time>
                                    <span><i class="fa fa-commenting"></i>评论0</span> 
                                    <span><i class="fa fa-star"></i>收藏0</span> 
                                </div>
                          </div>
                      </div>
                    </li> 
                                                                                       <li>
                                                <div class="atricle-list-right">
                          <h2 class="ellipsis2"><a class="hpf" href="https://www.ucloud.cn/yun/2207.html"><b>前端开发之<em><em>基础</em><em>知识</em></em>-<em>HTML</em>(一)</b></a></h2>
                                                     <p class="ellipsis2 good">摘要:文档规范文档规范制定了文档的编写规范,可部分遵守,也可全部遵守,看开发要求。标签行内元素,表示一行中的一小段内容,没有具体的语义。表示当前文件所在目录下的上一级目录,比如表示当前目录下的上一级目录下的文件夹中的的图片。
1.1 html概述和基本结构
html概述
HTML是 HyperText Mark-up Language 的首字母简写,意思是超文本标记语言,超文本指的是超链接,标记指...</p>
                                                   
                          <div class="com_white-left-info">
                                <div class="com_white-left-infol">
                                    <a href="https://www.ucloud.cn/yun/u-1725.html"><img src="https://www.ucloud.cn/yun/data/avatar/000/00/17/small_000001725.jpg" alt=""><span class="layui-hide64">番茄西红柿</span></a>
                                    <time datetime="">2019-04-23 13:41</time>
                                    <span><i class="fa fa-commenting"></i>评论0</span> 
                                    <span><i class="fa fa-star"></i>收藏0</span> 
                                </div>
                          </div>
                      </div>
                    </li> 
                                                                                       <li>
                                                <div class="atricle-list-right">
                          <h2 class="ellipsis2"><a class="hpf" href="https://www.ucloud.cn/yun/102346.html"><b>「前端早读君010」重学前端day1: <em>HTML</em><em>基础</em></b></a></h2>
                                                     <p class="ellipsis2 good">摘要:前言鉴于平时业务代码写多了,笔者对前端的一些基础知识都开始生疏。同理,对于而言,的标签也是具有容器含义的,譬如标签顾名思义就是尾部标签,存放内容的结尾块,标签表示头部。

前言
鉴于平时业务代码写多了,笔者对前端的一些基础知识都开始生疏。有鉴于此,加上又到了一年一度的春招时间,在接下来的一段时间内笔者将对整个前端体系的知识进行一些梳理,同时会附带上相关基础知识中常见的面试题。在笔者复习的...</p>
                                                   
                          <div class="com_white-left-info">
                                <div class="com_white-left-infol">
                                    <a href="https://www.ucloud.cn/yun/u-1712.html"><img src="https://www.ucloud.cn/yun/data/avatar/000/00/17/small_000001712.jpg" alt=""><span class="layui-hide64">wwq0327</span></a>
                                    <time datetime="">2019-08-23 15:37</time>
                                    <span><i class="fa fa-commenting"></i>评论0</span> 
                                    <span><i class="fa fa-star"></i>收藏0</span> 
                                </div>
                          </div>
                      </div>
                    </li> 
                                                                           
                </ul>
              </div>
              
               <div class="topicone-box-wangeditor">
                  
                  <h3 class="top-com-title mb-64"><span>发表评论</span></h3>
                   <div class="xcp-publish-main flex_box_zd">
                                      
                      <div class="unlogin-pinglun-box">
                        <a href="javascript:login()" class="grad">登陆后可评论</a>
                      </div>                   </div>
               </div>
              <div class="site-box-content">
                <div class="site-content-title">
                  <h3 class="top-com-title mb-64"><span>0条评论</span></h3>   
                </div> 
                      <div class="pages"></ul></div>
              </div>
           </div>
           <div class="layui-col-md4 layui-col-lg3 com_white-right site-wrap-right">
              <div class=""> 
                <div class="com_layuiright-box user-msgbox">
                    <a href="https://www.ucloud.cn/yun/u-989.html"><img src="https://www.ucloud.cn/yun/data/avatar/000/00/09/small_000000989.jpg" alt=""></a>
                    <h3><a href="https://www.ucloud.cn/yun/u-989.html" rel="nofollow">leeon</a></h3>
                    <h6>男<span>|</span>高级讲师</h6>
                    <div class="flex_box_zd user-msgbox-atten">
                     
                                                                      <a href="javascript:attentto_user(989)" id="attenttouser_989" class="grad follow-btn notfollow attention">我要关注</a>
      
                                                                                        <a href="javascript:login()" title="发私信" >我要私信</a>
                     
                                            
                    </div>
                    <div class="user-msgbox-list flex_box_zd">
                          <h3 class="hpf">TA的文章</h3>
                          <a href="https://www.ucloud.cn/yun/ut-989.html" class="box_hxjz">阅读更多</a>
                    </div>
                      <ul class="user-msgbox-ul">
                                                  <li><h3 class="ellipsis"><a href="https://www.ucloud.cn/yun/122579.html">【Python从入门到精通】五万六千字对Python基础知识做一个了结吧!(二十八)【值得收藏】</a></h3>
                            <p>阅读 561<span>·</span>2021-10-14 09:43</p></li>
                                                       <li><h3 class="ellipsis"><a href="https://www.ucloud.cn/yun/121681.html">Python爬虫--高性能的异步爬虫(五)</a></h3>
                            <p>阅读 1911<span>·</span>2021-09-30 09:48</p></li>
                                                       <li><h3 class="ellipsis"><a href="https://www.ucloud.cn/yun/119571.html">苹果秋季发布会官宣 9 月 15 日,全新 iPhone 13/Pro 系列即将到来</a></h3>
                            <p>阅读 3234<span>·</span>2021-09-08 09:45</p></li>
                                                       <li><h3 class="ellipsis"><a href="https://www.ucloud.cn/yun/118895.html">25k成功入职京东:拿到京东软件测试岗位offer经验分享</a></h3>
                            <p>阅读 940<span>·</span>2021-09-02 15:41</p></li>
                                                       <li><h3 class="ellipsis"><a href="https://www.ucloud.cn/yun/118499.html">creanova:creanova介绍,自营机房,芬兰VPS 10.00 EUR/月,芬兰服务器月付</a></h3>
                            <p>阅读 1737<span>·</span>2021-08-26 14:15</p></li>
                                                       <li><h3 class="ellipsis"><a href="https://www.ucloud.cn/yun/117913.html">CloudPowerall:洛杉矶Cera机房便宜VPS/1核1G/8 G存储/100Mbps AS</a></h3>
                            <p>阅读 604<span>·</span>2021-08-03 14:04</p></li>
                                                       <li><h3 class="ellipsis"><a href="https://www.ucloud.cn/yun/117508.html">让一排图片水平居中对齐</a></h3>
                            <p>阅读 2706<span>·</span>2019-08-30 15:56</p></li>
                                                       <li><h3 class="ellipsis"><a href="https://www.ucloud.cn/yun/116463.html">带标签的长标题省略展示的实现</a></h3>
                            <p>阅读 2952<span>·</span>2019-08-30 15:52</p></li>
                                                
                      </ul>
                </div>

                   <!-- 文章详情右侧广告-->
              
  <div class="com_layuiright-box">
                  <h6 class="top-com-title"><span>最新活动</span></h6> 
           
         <div class="com_adbox">
                    <div class="layui-carousel" id="right-item">
                      <div carousel-item>
                                                                                                                       <div>
                          <a href="https://www.ucloud.cn/site/product/uhost.html"  rel="nofollow">
                            <img src="https://www.ucloud.cn/yun/data/attach/220620/Z7TLrpAi.png" alt="云服务器">                                 
                          </a>
                        </div>
                                                <div>
                          <a href="https://www.ucloud.cn/site/product/uhybrid.html"  rel="nofollow">
                            <img src="https://www.ucloud.cn/yun/data/attach/220620/MWraMsBh.png" alt="混合云">                                 
                          </a>
                        </div>
                                                <div>
                          <a href="https://www.ucloud.cn/site/product/ucloudstack.html"  rel="nofollow">
                            <img src="https://www.ucloud.cn/yun/data/attach/220620/ifzOxvjW.png" alt="私有云">                                 
                          </a>
                        </div>
                                                <div>
                          <a href="https://www.ucloud.cn/site/product/utrion.html"  rel="nofollow">
                            <img src="https://www.ucloud.cn/yun/data/attach/220620/VDqwC1iN.png" alt="超融合服务器">                                 
                          </a>
                        </div>
                                                <div>
                          <a href="https://www.ucloud.cn/site/product/uhybrid.html"  rel="nofollow">
                            <img src="https://www.ucloud.cn/yun/data/attach/220630/pJwnviKN.png" alt="服务器托管">                                 
                          </a>
                        </div>
                                                <div>
                          <a href="https://www.ucloud.cn/site/product/uxzone.html"  rel="nofollow">
                            <img src="https://www.ucloud.cn/yun/data/attach/220630/CDb5uXxp.jpeg" alt="idc机房托管">                                 
                          </a>
                        </div>
                                                <div>
                          <a href="https://www.ucloud.cn/site/active/network.html?ytag=seo"  rel="nofollow">
                            <img src="https://www.ucloud.cn/yun/data/attach/230227/XWsSXmvm.png" alt="专线服务">                                 
                          </a>
                        </div>
                                                                   
                    
                        
                      </div>
                    </div>
                      
                    </div>                    <!-- banner结束 -->
              
<div class="adhtml">

</div>
                <script>
                $(function(){
                    $.ajax({
                        type: "GET",
                                url:"https://www.ucloud.cn/yun/ad/getad/1.html",
                                cache: false,
                                success: function(text){
                                  $(".adhtml").html(text);
                                }
                        });
                    })
                </script>                </div>              </div>
           </div>
        </div>
      </div> 
    </section>
    <!-- wap拉出按钮 -->
     <div class="site-tree-mobile layui-hide">
      <i class="layui-icon layui-icon-spread-left"></i>
    </div>
    <!-- wap遮罩层 -->
    <div class="site-mobile-shade"></div>
    
       <!--付费阅读 -->
       <div id="payread">
         <div class="layui-form-item">阅读需要支付1元查看</div>  
         <div class="layui-form-item"><button class="btn-right">支付并查看</button></div>     
       </div>
      <script>
      var prei=0;

       
       $(".site-seo-depict pre").each(function(){
          var html=$(this).html().replace("<code>","").replace("</code>","").replace('<code class="javascript hljs" codemark="1">','');
          $(this).attr('data-clipboard-text',html).attr("id","pre"+prei);
          $(this).html("").append("<code>"+html+"</code>");
         prei++;
       })
           $(".site-seo-depict img").each(function(){
             
            if($(this).attr("src").indexOf('data:image/svg+xml')!= -1){
                $(this).remove();
            }
       })
     $("LINK[href*='style-49037e4d27.css']").remove();
       $("LINK[href*='markdown_views-d7a94ec6ab.css']").remove();
layui.use(['jquery', 'layer','code'], function(){
  $("pre").attr("class","layui-code");
      $("pre").attr("lay-title","");
       $("pre").attr("lay-skin","");
  layui.code(); 
       $(".layui-code-h3 a").attr("class","copycode").html("复制代码 ").attr("onclick","copycode(this)");
      
});
function copycode(target){
    var id=$(target).parent().parent().attr("id");
  
                  var clipboard = new ClipboardJS("#"+id);

clipboard.on('success', function(e) {


    e.clearSelection();
    alert("复制成功")
});

clipboard.on('error', function(e) {
    alert("复制失败")
});
}
//$(".site-seo-depict").html($(".site-seo-depict").html().slice(0, -5));
</script>
  <link rel="stylesheet" type="text/css" href="https://www.ucloud.cn/yun/static/js/neweditor/code/styles/tomorrow-night-eighties.css">
    <script src="https://www.ucloud.cn/yun/static/js/neweditor/code/highlight.pack.js" type="text/javascript"></script>
    <script src="https://www.ucloud.cn/yun/static/js/clipboard.js"></script>

<script>hljs.initHighlightingOnLoad();</script>

<script>
    function setcode(){
        var _html='';
    	  document.querySelectorAll('pre code').forEach((block) => {
        	  var _tmptext=$.trim($(block).text());
        	  if(_tmptext!=''){
        		  _html=_html+_tmptext;
        		  console.log(_html);
        	  }
    		 
    		  
    		 
      	  });
    	 

    }

</script>

<script>
function payread(){
  layer.open({
      type: 1,
      title:"付费阅读",
      shadeClose: true,
      content: $('#payread')
    });
}
// 举报
function jupao_tip(){
  layer.open({
      type: 1,
      title:false,
      shadeClose: true,
      content: $('#jubao')
    });

}
$(".getcommentlist").click(function(){
var _id=$(this).attr("dataid");
var _tid=$(this).attr("datatid");
$("#articlecommentlist"+_id).toggleClass("hide");
var flag=$("#articlecommentlist"+_id).attr("dataflag");
if(flag==1){
flag=0;
}else{
flag=1;
//加载评论
loadarticlecommentlist(_id,_tid);
}
$("#articlecommentlist"+_id).attr("dataflag",flag);

})
$(".add-comment-btn").click(function(){
var _id=$(this).attr("dataid");
$(".formcomment"+_id).toggleClass("hide");
})
$(".btn-sendartcomment").click(function(){
var _aid=$(this).attr("dataid");
var _tid=$(this).attr("datatid");
var _content=$.trim($(".commenttext"+_aid).val());
if(_content==''){
alert("评论内容不能为空");
return false;
}
var touid=$("#btnsendcomment"+_aid).attr("touid");
if(touid==null){
touid=0;
}
addarticlecomment(_tid,_aid,_content,touid);
})
 $(".button_agree").click(function(){
 var supportobj = $(this);
         var tid = $(this).attr("id");
         $.ajax({
         type: "GET",
                 url:"https://www.ucloud.cn/yun/index.php?topic/ajaxhassupport/" + tid,
                 cache: false,
                 success: function(hassupport){
                 if (hassupport != '1'){






                         $.ajax({
                         type: "GET",
                                 cache:false,
                                 url: "https://www.ucloud.cn/yun/index.php?topic/ajaxaddsupport/" + tid,
                                 success: function(comments) {

                                 supportobj.find("span").html(comments+"人赞");
                                 }
                         });
                 }else{
                	 alert("您已经赞过");
                 }
                 }
         });
 });
 function attenquestion(_tid,_rs){
    	$.ajax({
    //提交数据的类型 POST GET
    type:"POST",
    //提交的网址
    url:"https://www.ucloud.cn/yun/favorite/topicadd.html",
    //提交的数据
    data:{tid:_tid,rs:_rs},
    //返回数据的格式
    datatype: "json",//"xml", "html", "script", "json", "jsonp", "text".
    //在请求之前调用的函数
    beforeSend:function(){},
    //成功返回之后调用的函数
    success:function(data){
    	var data=eval("("+data+")");
    	console.log(data)
       if(data.code==2000){
    	layer.msg(data.msg,function(){
    	  if(data.rs==1){
    	      //取消收藏
    	      $(".layui-layer-tips").attr("data-tips","收藏文章");
    	      $(".layui-layer-tips").html('<i class="fa fa-heart-o"></i>');
    	  }
    	   if(data.rs==0){
    	      //收藏成功
    	      $(".layui-layer-tips").attr("data-tips","已收藏文章");
    	      $(".layui-layer-tips").html('<i class="fa fa-heart"></i>')
    	  }
    	})
    	 
       }else{
    	layer.msg(data.msg)
       }


    }   ,
    //调用执行后调用的函数
    complete: function(XMLHttpRequest, textStatus){
     	postadopt=true;
    },
    //调用出错执行的函数
    error: function(){
        //请求出错处理
    	postadopt=false;
    }
 });
}
</script>
<footer>
        <div class="layui-container">
            <div class="flex_box_zd">
              <div class="left-footer">
                    <h6><a href="https://www.ucloud.cn/"><img src="https://www.ucloud.cn/yun/static/theme/ukd//images/logo.png" alt="UCloud (优刻得科技股份有限公司)"></a></h6>
                    <p>UCloud (优刻得科技股份有限公司)是中立、安全的云计算服务平台,坚持中立,不涉足客户业务领域。公司自主研发IaaS、PaaS、大数据流通平台、AI服务平台等一系列云计算产品,并深入了解互联网、传统企业在不同场景下的业务需求,提供公有云、混合云、私有云、专有云在内的综合性行业解决方案。</p>
              </div>
              <div class="right-footer layui-hidemd">
                  <ul class="flex_box_zd">
                      <li>
                        <h6>UCloud与云服务</h6>
                         <p><a href="https://www.ucloud.cn/site/about/intro/">公司介绍</a></p>
                         <p><a href="https://zhaopin.ucloud.cn/" >加入我们</a></p>
                         <p><a href="https://www.ucloud.cn/site/ucan/onlineclass/">UCan线上公开课</a></p>
                         <p><a href="https://www.ucloud.cn/site/solutions.html" >行业解决方案</a></p>                                                  <p><a href="https://www.ucloud.cn/site/pro-notice/">产品动态</a></p>
                      </li>
                      <li>
                        <h6>友情链接</h6>                                             <p><a href="https://www.compshare.cn/?ytag=seo">GPU算力平台</a></p>                                             <p><a href="https://www.ucloudstack.com/?ytag=seo">UCloud私有云</a></p>
                                             <p><a href="https://www.surfercloud.com/">SurferCloud</a></p>                                             <p><a href="https://www.uwin-link.com/">工厂仿真软件</a></p>                                             <p><a href="https://pinex.it/">Pinex</a></p>                                             <p><a href="https://www.picpik.ai/zh">AI绘画</a></p>
                                             
                      </li>
                      <li>
                        <h6>社区栏目</h6>
                         <p><a href="https://www.ucloud.cn/yun/column/index.html">专栏文章</a></p>
                     <p><a href="https://www.ucloud.cn/yun/udata/">专题地图</a></p>                      </li>
                      <li>
                        <h6>常见问题</h6>
                         <p><a href="https://www.ucloud.cn/site/ucsafe/notice.html" >安全中心</a></p>
                         <p><a href="https://www.ucloud.cn/site/about/news/recent/" >新闻动态</a></p>
                         <p><a href="https://www.ucloud.cn/site/about/news/report/">媒体动态</a></p>                                                  <p><a href="https://www.ucloud.cn/site/cases.html">客户案例</a></p>                                                
                         <p><a href="https://www.ucloud.cn/site/notice/">公告</a></p>
                      </li>
                      <li>
                          <span><img src="https://static.ucloud.cn/7a4b6983f4b94bcb97380adc5d073865.png" alt="优刻得"></span>
                          <p>扫扫了解更多</p></div>
            </div>
            <div class="copyright">Copyright © 2012-2023 UCloud 优刻得科技股份有限公司<i>|</i><a rel="nofollow" href="http://beian.miit.gov.cn/">沪公网安备 31011002000058号</a><i>|</i><a rel="nofollow" href="http://beian.miit.gov.cn/"></a> 沪ICP备12020087号-3</a><i>|</i> <script type="text/javascript" src="https://gyfk12.kuaishang.cn/bs/ks.j?cI=197688&fI=125915" charset="utf-8"></script>
<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?290c2650b305fc9fff0dbdcafe48b59d";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-DZSMXQ3P9N"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'G-DZSMXQ3P9N');
</script>
<script>
(function(){
var el = document.createElement("script");
el.src = "https://lf1-cdn-tos.bytegoofy.com/goofy/ttzz/push.js?99f50ea166557aed914eb4a66a7a70a4709cbb98a54ecb576877d99556fb4bfc3d72cd14f8a76432df3935ab77ec54f830517b3cb210f7fd334f50ccb772134a";
el.id = "ttzz";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(el, s);
})(window)
</script></div> 
        </div>
    </footer>
</body>
<script src="https://www.ucloud.cn/yun/static/theme/ukd/js/common.js"></script>
<<script type="text/javascript">
$(".site-seo-depict *,.site-content-answer-body *,.site-body-depict *").css("max-width","100%");
</script>
</html>