tw4ld6 发表于 2024-6-29 17:03:16

Web前端:html常用知识点整理总结(长篇-仔细自用)


    <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>语义再安排放在哪<span style="color: black;">运用</span>,<span style="color: black;">不外</span>页面大部分布局都是div搞定,不讲究SEO优化<span style="color: black;">能够</span>不<span style="color: black;">思虑</span>H5新增的容器标签,<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>分享一个网站:<a style="color: black;">python自学网</a>,想学python<span style="color: black;">关联</span>的或者python全栈工程师,GUI界面化图形等都<span style="color: black;">能够</span>去<span style="color: black;">认识</span>下,web<span style="color: black;">研发</span><span style="color: black;">亦</span>是有<span style="color: black;">关联</span>课程的。</p>
    <h3 style="color: black; text-align: left; margin-bottom: 10px;"><span style="color: black;">1、</span>HTML文档结构:</h3>
    <div style="color: black; text-align: left; margin-bottom: 10px;"><span style="color: black;">&lt;!DOCTYPE html&gt;</span>
      <span style="color: black;">&lt;!-- 文档声明,告诉浏览器当前<span style="color: black;">运用</span>的HTML标准是HTML5,<span style="color: black;">必定</span>在<span style="color: black;">第1</span>行 --&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;">"en"</span><span style="color: black;">&gt;</span>
      <span style="color: black;">&lt;!--
      </span><span style="color: black;">&lt;html&gt;&lt;/html&gt;:根标签,告诉浏览器自己是HTML文档给,所有的标签都写在它的里面</span><span style="color: black;"> lang="en":lang属性,<span style="color: black;">暗示</span>该元素<span style="color: black;">运用</span>的文字是哪一种语言,en英文,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;</span>
      <span style="color: black;">&lt;!-- &lt;head&gt;&lt;/head&gt;:文档头,在它里面的内容<span style="color: black;">通常</span>设置网页<span style="color: black;">关联</span>信息,不会被渲染在网页页面上--&gt;</span>
      <span style="color: black;">&lt;</span><span style="color: black;">meta</span> <span style="color: black;">charset</span><span style="color: black;">=</span><span style="color: black;">"UTF-8"</span> <span style="color: black;">/&gt;</span>
      <span style="color: black;">&lt;!--
      </span><span style="color: black;"> &lt;meta/&gt;:元属性描述,文档的原数据(附加信息),单标签
      </span><span style="color: black;"> charset="UTF-8":字符编码,制定网页内容编码为UTF-8
      </span><span style="color: black;"> --&gt;</span>
      <span style="color: black;">&lt;</span><span style="color: black;">meta</span> <span style="color: black;">http-equiv</span><span style="color: black;">=</span><span style="color: black;">"X-UA-Compatible"</span> <span style="color: black;">content</span><span style="color: black;">=</span><span style="color: black;">"IE=edge"</span> <span style="color: black;">/&gt;</span>
      <span style="color: black;">&lt;!--
      </span><span style="color: black;">http-equiv="X-UA-Compatible" :文档兼容模式的定义</span><span style="color: black;"> Edge模式告诉IE以最高级 模式渲染文档,<span style="color: black;">亦</span><span style="color: black;">便是</span>任何IE版本都以当前版本所支持的最高级标准模式渲染,避免版本升级<span style="color: black;">导致</span>的影响。
      </span><span style="color: black;"> --&gt;</span>
      <span style="color: black;">&lt;</span><span style="color: black;">meta</span> <span style="color: black;">name</span><span style="color: black;">=</span><span style="color: black;">"viewport"</span> <span style="color: black;">content</span><span style="color: black;">=</span><span style="color: black;">"width=device-width, initial-scale=1.0"</span> <span style="color: black;">/&gt;</span>
      <span style="color: black;">&lt;!--
      </span><span style="color: black;"> 手机端适配,不写手机端页面<span style="color: black;">不消</span>
      </span><span style="color: black;"> viewport:用于指定用户<span style="color: black;">是不是</span><span style="color: black;">能够</span>缩放Web页面,并对<span style="color: black;">关联</span>的选项进行设定
      </span><span style="color: black;">width或height:指定视区的<span style="color: black;">规律</span>宽度和高度,取值<span style="color: black;">能够</span>是以像素单位的数字,<span style="color: black;">亦</span><span style="color: black;">能够</span>是特殊的标记符号(device-width:视区宽度应为设备的屏幕宽度,device-width同理)</span><span style="color: black;"> initial-scale:设置Web页面的初始缩放比例,值设为1.0则<span style="color: black;">表示</span>未经缩放的Web页面
      </span><span style="color: black;"> --&gt;</span>
      <span style="color: black;">&lt;</span><span style="color: black;">title</span><span style="color: black;">&gt;</span>Document<span style="color: black;">&lt;/</span><span style="color: black;">title</span><span style="color: black;">&gt;</span>
      <span style="color: black;">&lt;!-- &lt;title&gt;&lt;/title&gt;:网页标题--&gt;</span>
      <span style="color: black;">&lt;</span><span style="color: black;">link</span> <span style="color: black;">rel</span><span style="color: black;">=</span><span style="color: black;">"shortcut icon"</span> <span style="color: black;">href</span><span style="color: black;">=</span><span style="color: black;">"favicon.ico"</span> <span style="color: black;">type</span><span style="color: black;">=</span><span style="color: black;">"image/x-icon"</span><span style="color: black;">&gt;</span>
      <span style="color: black;">&lt;</span><span style="color: black;">link</span> <span style="color: black;">rel</span><span style="color: black;">=</span><span style="color: black;">"stylesheet"</span> <span style="color: black;">href</span><span style="color: black;">=</span><span style="color: black;">"style.css"</span><span style="color: black;">&gt;</span>
      <span style="color: black;">&lt;</span><span style="color: black;">script</span> <span style="color: black;">type</span><span style="color: black;">=</span><span style="color: black;">"text/javascript"</span> <span style="color: black;">src</span><span style="color: black;">=</span><span style="color: black;">"index.js"</span><span style="color: black;">&gt;&lt;/</span><span style="color: black;">script</span><span style="color: black;">&gt;</span>
      <span style="color: black;">&lt;!-- 页面图标、加载<span style="color: black;">外边</span>的css/js文件......--&gt;</span>
      <span style="color: black;">&lt;/</span><span style="color: black;">head</span><span style="color: black;">&gt;</span>
      <span style="color: black;">&lt;</span><span style="color: black;">body</span><span style="color: black;">&gt;</span>
      <span style="color: black;">&lt;!-- &lt;body&gt;&lt;/body&gt;:写网页的主体,里面放内容标签,如a、p、img、h1~h6等 --&gt;</span>
      <span style="color: black;">&lt;/</span><span style="color: black;">body</span><span style="color: black;">&gt;</span>
      <span style="color: black;">&lt;/</span><span style="color: black;">html</span><span style="color: black;">&gt;</span>
    </div>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">简单文档结构:如下</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;</span><span style="color: black;">html</span> <span style="color: black;">lang</span><span style="color: black;">=</span><span style="color: black;">"en"</span><span style="color: black;">&gt;</span>
      <span style="color: black;">&lt;</span><span style="color: black;">head</span><span style="color: black;">&gt;</span>
      <span style="color: black;">&lt;</span><span style="color: black;">meta</span> <span style="color: black;">charset</span><span style="color: black;">=</span><span style="color: black;">"UTF-8"</span> <span style="color: black;">/&gt;</span>
      <span style="color: black;">&lt;</span><span style="color: black;">title</span><span style="color: black;">&gt;</span>Document<span style="color: black;">&lt;/</span><span style="color: black;">title</span><span style="color: black;">&gt;</span>
      <span style="color: black;">&lt;/</span><span style="color: black;">head</span><span style="color: black;">&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;/</span><span style="color: black;">html</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>一个html文件了。</p>
    <h3 style="color: black; text-align: left; margin-bottom: 10px;"><span style="color: black;">2、</span>注释、标签、元素、属性</h3>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">注释:快捷键 ctrl+/ ,注释的内容不会被浏览器渲染在页面上,给<span style="color: black;">研发</span>者自己看的 </p>
    <h3 style="color: black; text-align: left; margin-bottom: 10px;">1.1标签</h3>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">标签概念:由尖括号“&lt; &gt;”<span style="color: black;">包裹</span>的<span style="color: black;">重要</span>词,<span style="color: black;">通常</span>是成对<span style="color: black;">显现</span>的,标签对中<span style="color: black;">第1</span>个标签是<span style="color: black;">起始</span>标签如&lt;body&gt; ,第二个标签是结束标签如 &lt;/body&gt;</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;"> ​ 双标签:&lt;<span style="color: black;">起始</span>标签&gt; 结束标签&gt;</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"> ​ 单(空)标签:&lt;标签名/&gt; (<span style="color: black;">无</span>结束标签)</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">标签内容:</p>​ 双标签,其内容在两个标签中间




外链专员 发表于 2024-8-30 14:43:18

你的话语如春风拂面,让我心生暖意。

m5k1umn 发表于 2024-9-29 01:23:58

楼主听话,多发外链好处多,快到碗里来!外链论坛 http://www.fok120.com/

m5k1umn 发表于 2024-9-29 20:16:32

楼主继续加油啊!外链论坛加油!

4lqedz 发表于 2024-10-4 08:17:33

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

qzmjef 发表于 2024-10-10 08:53:17

你的见解独到,让我受益匪浅,非常感谢。

qzmjef 发表于 2024-10-12 20:19:43

你的见解独到,让我受益匪浅,非常感谢。

m5k1umn 发表于 2024-11-3 06:23:58

回顾历史,我们感慨万千;放眼未来,我们信心百倍。
页: [1]
查看完整版本: Web前端:html常用知识点整理总结(长篇-仔细自用)