nykek5i 发表于 2024-6-29 17:05:39

浅谈前端 | HTML

<span style="color: black;">微X</span>公众号搜索【程序媛小庄】,人生苦短 <span style="color: black;">一块</span>学python<h2 style="color: black; text-align: left; margin-bottom: 10px;">前言</h2>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">本文<span style="color: black;">重点</span>介绍什么是HTML以及HTML语言常用的标签,<span style="color: black;">经过</span>HTML语言就<span style="color: black;">能够</span>为<span style="color: black;">咱们</span>搭建网站<span style="color: black;">供给</span>骨架啦,在网页上右键鼠标<span style="color: black;">选取</span>查看网页源代码<span style="color: black;">能够</span>看到网页html源代码哦~</p>
    <h2 style="color: black; text-align: left; margin-bottom: 10px;">什么是HTML</h2>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">HTML全<span style="color: black;">叫作</span>超文本标记语言(Hypertext Markup Language, HTML),一种用于创建网页的标记语言,<span style="color: black;">必须</span><span style="color: black;">重视</span>的是,HTML是一种标记语言(markup lanuage),不是一种编程语言,在HTML中<span style="color: black;">运用</span>标签来描述网页。</p>
    <h2 style="color: black; text-align: left; margin-bottom: 10px;">HTML注释</h2>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">虽然HTML不是编程语言,<span style="color: black;">然则</span>HTML<span style="color: black;">亦</span>有注释,HTML代码如下:</p>
    <div style="color: black; text-align: left; margin-bottom: 10px;"><span style="color: black;">&lt;!--单行注释--&gt;</span>
      <span style="color: black;">&lt;!--
      </span><span style="color: black;">多行注释</span><span style="color: black;">多行注释
      </span><span style="color: black;">--&gt;</span>
    </div>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">因为</span>HTML代码非常杂乱,并且非常的多,<span style="color: black;">因此</span>习惯用注释划定页面区域方便后续<span style="color: black;">查询</span>,<span style="color: black;">例如</span>:</p>
    <div style="color: black; text-align: left; margin-bottom: 10px;"><span style="color: black;">&lt;!--导航条<span style="color: black;">起始</span>--&gt;</span>
      导航条内所有html代码
      <span style="color: black;">&lt;!--导航条结束--&gt;</span>
      ​
      <span style="color: black;">&lt;!--左侧菜单栏<span style="color: black;">起始</span>--&gt;</span>
      左侧菜单栏所有html代码
      <span style="color: black;">&lt;!--左侧菜单栏代码结束--&gt;</span>
    </div>
    <h2 style="color: black; text-align: left; margin-bottom: 10px;">HTML文档结构</h2>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">HTML文件的后缀名<span style="color: black;">通常</span>都是.html,文件的后缀名其实是给用户看的,只<span style="color: black;">不外</span>对应<span style="color: black;">区别</span>的文件后缀名有<span style="color: black;">区别</span>的软件来处理,并添加<span style="color: black;">非常多</span>功能,HTML<span style="color: black;">无</span>代码格式,<span style="color: black;">能够</span><span style="color: black;">所有</span>写在一行<span style="color: black;">亦</span><span style="color: black;">无</span>问题,只<span style="color: black;">不外</span><span style="color: black;">运用</span>缩进尽可能的<span style="color: black;">加强</span>代码的可读性。</p>
    <div style="color: black; text-align: left; margin-bottom: 10px;">​
      <span style="color: black;">&lt;!DOCTYPE html&gt;</span> <span style="color: black;">&lt;!--声明是HTML5文档--&gt;</span>
      <span style="color: black;">&lt;</span><span style="color: black;">html</span> <span style="color: black;">lang</span><span style="color: black;">=</span><span style="color: black;">"zh-CN"</span><span style="color: black;">&gt;</span>
      <span style="color: black;">&lt;</span><span style="color: black;">head</span><span style="color: black;">&gt;&lt;/</span><span style="color: black;">head</span><span style="color: black;">&gt;</span> <span style="color: black;">&lt;!--head内的标签不是给用户看的,而是定义<span style="color: black;">有些</span>配置<span style="color: black;">重点</span>是给浏览器看的--&gt;</span>
      <span style="color: black;">&lt;</span><span style="color: black;">body</span><span style="color: black;">&gt;&lt;/</span><span style="color: black;">body</span><span style="color: black;">&gt;</span> <span style="color: black;">&lt;!--body内的标签,写什么浏览器就渲染什么,用户就能看到什么--&gt;</span>
      <span style="color: black;">&lt;/</span><span style="color: black;">html</span><span style="color: black;">&gt;</span>
      ​
    </div>
    <h2 style="color: black; text-align: left; margin-bottom: 10px;">打开HTML文件的两种方式</h2>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">第1</span>种,找到HTML文件的位置,右键<span style="color: black;">选取</span>浏览器打开;</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">第二种,在pycharm内部继承了自动调用浏览器的功能,直接点击<span style="color: black;">就可</span>,前提是计算机上安装了相应的浏览器。</p>
    <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://pic1.zhimg.com/80/v2-314802d4290f4b73ae5bb319c442d1b0_720w.webp" style="width: 50%; margin-bottom: 20px;"></div>
    <h2 style="color: black; text-align: left; margin-bottom: 10px;">HTML标签简介</h2>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">①HTML标签<span style="color: black;">是由于</span>尖括号<span style="color: black;">包裹</span>的<span style="color: black;">重要</span>字,<span style="color: black;">例如</span>&lt;html&gt;, &lt;body&gt;等;</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">②HTML标签<span style="color: black;">一般</span>都是成对<span style="color: black;">显现</span>的,<span style="color: black;">例如</span>&lt;html&gt;&lt;/html&gt;,<span style="color: black;">第1</span>个标签是<span style="color: black;">初始</span>标签,第二个标签是结束标签,结束标签会有左斜线;</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">③<span style="color: black;">亦</span>有<span style="color: black;">有些</span>单标签,<span style="color: black;">例如</span>&lt;br/&gt;,&lt;hr/&gt;等,遇到了记一下就<span style="color: black;">能够</span>了;</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">④标签里面<span style="color: black;">能够</span>带<span style="color: black;">各样</span>属性,<span style="color: black;">亦</span><span style="color: black;">能够</span>不带属性。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">下面介绍一下html标签的语法,分为单标签和双标签:</p>
    <div style="color: black; text-align: left; margin-bottom: 10px;"><span style="color: black;">&lt;!--单标签--&gt;</span>
      <span style="color: black;">&lt;</span><span style="color: black;">标签名</span> <span style="color: black;">属性1</span><span style="color: black;">=</span><span style="color: black;">"属性值1"</span> <span style="color: black;">属性2</span><span style="color: black;">=</span><span style="color: black;">"属性值2"</span><span style="color: black;">....</span><span style="color: black;">/&gt;</span>
      ​
      <span style="color: black;">&lt;!--双标签--&gt;</span>
      <span style="color: black;">&lt;</span><span style="color: black;">标签名</span> <span style="color: black;">属性1</span><span style="color: black;">=</span><span style="color: black;">"属性值1"</span> <span style="color: black;">属性2</span><span style="color: black;">=</span><span style="color: black;">"属性值2"</span><span style="color: black;">...</span><span style="color: black;">&gt;</span>内容<span style="color: black;">&lt;/</span><span style="color: black;">标签名</span><span style="color: black;">&gt;</span>
    </div>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">标签<span style="color: black;">亦</span>分为行内标签和块级标签,块级标签会<span style="color: black;">独霸</span>一行,而行内标签<span style="color: black;">自己</span>文本有多大就占多大位置,<span style="color: black;">平常</span>的行内标签有i,u,s,b,span标签,块级标签有h,p,div标签。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">块级标签和行内标签的区别有以下几点:</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">①块级标签<span style="color: black;">能够</span>修改长宽,行内标签不<span style="color: black;">能够</span>,修改了<span style="color: black;">亦</span>不会变 。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">②块级标签内部<span style="color: black;">能够</span>嵌套任意的块级标签和行内标签,<span style="color: black;">然则</span>p标签虽然是块级标签,<span style="color: black;">然则</span>它只能嵌套行内标签,<span style="color: black;">不可</span>嵌套块级标签 <span style="color: black;">倘若</span>套了,问题<span style="color: black;">亦</span>不大,浏览器会自动解开嵌套,<span style="color: black;">由于</span>浏览器是直接面向用户的,不会轻易报错,哪怕报错用户<span style="color: black;">亦</span>感觉不出来 。</p>③行内标签<span style="color: black;">不可</span>嵌套块级标签,<span style="color: black;">能够</span>嵌套行内标签。<h2 style="color: black; text-align: left; margin-bottom: 10px;">HTML常用标签</h2>
    <h3 style="color: black; text-align: left; margin-bottom: 10px;">hea</h3>




youxijiasuqi 发表于 2024-8-26 11:19:44

i免费外链发布平台 http://www.fok120.com/

大哥 发表于 2024-9-8 21:04:29

感谢你的精彩评论,为我的思绪打开了新的窗口。

bitheerani12500 发表于 2024-9-10 06:42:31

外链论坛的成功举办,是与各位领导、同仁们的关怀和支持分不开的。在此,我谨代表公司向关心和支持论坛的各界人士表示最衷心的感谢!

4zhvml8 发表于 2024-10-10 17:57:17

你的话深深触动了我,仿佛说出了我心里的声音。

qzmjef 发表于 2024-10-12 15:28:27

“NB”(牛×的缩写,表示叹为观止)‌

wrjc1hod 发表于 2024-11-5 03:36:39

“NB”(牛×的缩写,表示叹为观止)‌
页: [1]
查看完整版本: 浅谈前端 | HTML