目录
基础框架
了不起的盖茨比
了解HTML的代码注释
认识标签
标签,网页上显示的内容放在这里
开始学习

标签,添加段落

了解标签,为你的网页添加标题
是最高的等级。

语法:标题文本 x:1-6

注意:因为h1标签在网页中比较重要,所以一般h1标签被用在网站名称上。腾讯网站就是这样做的。如:

腾讯网

加入强调语气,使用标签
使用标签为文字设置单独样式
标签,短文本引用
标签,长文本引用
使用
标签分行显示文本
《咏桂》
为你的网页中添加一些空格
认识
标签,添加水平横线
标签,为网页加入地址信息
想加入一行代码吗?使用标签
使用
标签为你的网页加入大段代码
								
使用
使用
    ,添加顺序列表
初识div
认识div在排版中的作用
给div命名,使逻辑更加清晰
table标签,认识网页上的表格
table标签 = 我们平时看到到表格
用css样式,为表格加入边框
caption标签,为表格添加标题和摘要
初识标签
使用标签,链接到另一个页面
在新建浏览器窗口中打开链接
使用mailto在网页中链接Email地址
标签,为网页插入图片" >认识HTML 入门笔记 - 初识HTML_html/css_WEB-ITnose标签,为网页插入图片
认识表单
使用表单标签,与用户交互
文本输入框、密码输入框
文本域,支持多行文本输入
使用单选框、复选框,让用户选择
使用下拉列表框,节省空间
使用下拉列表框进行多选
使用提交按钮,提交数据
使用重置按钮,重置表单信息
form表单中的label标签
首页 web前端 html教程 HTML 入门笔记 - 初识HTML_html/css_WEB-ITnose

HTML 入门笔记 - 初识HTML_html/css_WEB-ITnose

Jun 24, 2016 am 11:25 AM

本人在慕课网学习HTML+CSS基础课程,记录一些文字,方便自己回忆,也希望对大家有所帮助


基础框架

<!DOCTYPE HTML><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>标题标签</title></head><body>    <h1 id="了不起的盖茨比">了不起的盖茨比</h1>    <p>《了不起的盖茨比》为那个奢靡年代的缩影。盖茨比怀揣着对"美国梦"的期翼,投身到那个年代的灯红酒绿之中,却在名利场中看尽世态炎凉,以及浮华背后一切终将逝去的空虚怅惘。1925年《了不起的盖茨比》问世。    </p></body></html>
登录后复制

了解HTML的代码注释

什么是代码注释?代码注释的作用是帮助程序员标注代码的用途,过一段时间后再看你所编写的代码,就能很快想起这段代码的用途。代码注释不仅方便程序员自己回忆起以前代码的用途,还可以帮助其他程序员很快的读懂你的程序的功能,方便多人合作开发网页代码。

语法:

认识标签

文档的头部描述了文档的各种属性和信息,包括文档的标题等。绝大多数文档头部包含的数据都不会真正作为内容显示给读者。

<head>    <title>...</title>    <meta>    <link>    <style>...</style>    <script>...</script></head>
登录后复制
  1. 标签在<title> 和<title> 标签之间的文字内容是网页的标题信息,它会出现在浏览器的标题栏中。网页的title标签用于告诉用户和搜索引擎这个网页的主要内容是什么,搜索引擎可以通过网页标题,迅速的判断出网页的主题。每个网页的内容都是不同的,每个网页都应该有一个独一无二的title。例如:<div class="code" style="position:relative; padding:0px; margin:0px;"><pre class='brush:php;toolbar:false;'><head> <title>hello world</title></head></pre><div class="contentsignin">登录后复制</div></div><title>标签的内容“hello world”会在浏览器中的标题栏上显示出来,如下图所示 <p> <p></p> </p></li> </ol> <hr /> <h2 id="strong-body-标签-网页上显示的内容放在这里-strong"><strong><body>标签,网页上显示的内容放在这里</strong></h2> <p>在网页上要展示出来的页面内容一定要放在body标签中。如下图是一个新闻文章的网页。</p> <p> <p></p> </p> <hr /> <h2 id="strong-开始学习-p-标签-添加段落-strong"><strong>开始学习<p>标签,添加段落</strong></h2> <p>如果想在网页上显示文章,这时就需要<p>标签了,把文章的段落放到<p>标签中。 </p> <p>语法: <p>段落文本</p> </p> <p>注意一段文字一个<p>标签,如在一篇新闻文章中有3段文字,就要把这3个段落分别放到3个<p>标签中。如下图所示。</p> <p> <p></p> </p> <hr /> <h2 id="strong-了解-hx-标签-为你的网页添加标题-strong"><strong>了解<hx(1-6)>标签,为你的网页添加标题</strong></h2> <p>文章的段落用<p>标签,那么文章的标题用什么标签呢?在本节我们将使用<hx>标签来制作文章的标题。标题标签一共有6个,h1、h2、h3、h4、h5、h6分别为一级标题、二级标题、三级标题、四级标题、五级标题、六级标题。并且依据重要性递减。<h1 id="是最高的等级-p-p-语法-hx-标题文本-hx-x-p-p-注意-因为h-标签在网页中比较重要-所以一般h-标签被用在网站名称上-腾讯网站就是这样做的-如-h-腾讯网">是最高的等级。 </p> <p>语法:<hx>标题文本</hx> x:1-6</p> <p>注意:因为h1标签在网页中比较重要,所以一般h1标签被用在网站名称上。腾讯网站就是这样做的。如:<h1>腾讯网</h1> </p> <p>h1-h6标签的默认样式:标签代码:</p> <p> <p></p> </p> <p>在浏览器中显示的样式:</p> <p> <p></p> </p> <hr /> <h2 id="strong-加入强调语气-使用-strong-和-em-标签-strong"><strong>加入强调语气,使用<strong>和<em>标签</strong></h2> <p>有了段落又有了标题,现在如果想在一段话中特别强调某几个文字,这时候就可以用到<em>或<strong>标签但两者在强调的语气上有区别: </p> <ul> <li><em> 表示强调,在浏览器中<em> 默认用斜体表示</li> <li><strong>表示更强烈的强调,在浏览器中<strong>用粗体表示。</li> <li>两个标签相比,目前国内前端程序员更喜欢使用<strong>表示强调。</li> </ul> <p>在浏览器中默认样式是有区别的:</p> <p> <p></p> </p> <p>浏览器中的样子,如下图。</p> <p> <p></p> </p> <p>语法:<em>需要强调的文本</em><strong>需要强调的文本</strong></p> <p>栗子:在网上商城中,某产品的打折后的价格是需要强调的。如下图。</p> <p> <p></p> </p> <p>代码实现:</p> <p> <p></p> </p> <hr /> <h2 id="strong-使用-span-标签为文字设置单独样式-strong"><strong>使用<span>标签为文字设置单独样式</strong></h2> <p>语法:<span>文本</span></p> <p>我们对<em>、<strong>、<span>这三个标签进行一下总结:</p> <ol> <li><p><em>和<strong>标签是为了强调一段话中的关键字时使用,它们的语义是强调。</p></li> <li><p><span>标签是没有语义的,它的作用就是为了设置单独的样式用的。</p></li> </ol> <p>如果现在我们想把上一小节的第一段话“美国梦”三个字设置成blue(蓝色),但注意不是为了强调“美国梦”,而只是想为它设置和其它文字不同的样式(并不想让屏幕阅读器对“美国梦”这三个字加重音读出),所以这样情况下就可以用到<span>标签了。如下面例子:</p> <div class="code" style="position:relative; padding:0px; margin:0px;"><pre class='brush:php;toolbar:false;'><p>1922年的春天,一个想要成名名叫<em>尼克•卡拉威</em>(托比•马奎尔Tobey Maguire 饰)的作家,离开了美国中西部,来到了纽约。那是一个道德感渐失,爵士乐流行,走私为王,<strong>股票</strong>飞涨的时代。为了追寻他的<span>美国梦</span>,他搬入纽约附近一海湾居住。</p></pre><div class="contentsignin">登录后复制</div></div> <p>我们如果想设置“美国梦”三个字设置成blue(蓝色),只需要在<style>标签中加入:</p> <div class="code" style="position:relative; padding:0px; margin:0px;"><pre class='brush:php;toolbar:false;'>span{ color:blue;}</pre><div class="contentsignin">登录后复制</div></div> <p>css部分,以后会聊,你能大概明白span就是能干单独设置样式的活,就ok了 </p> <hr /> <h2 id="strong-q-标签-短文本引用-strong"><strong><q>标签,短文本引用</strong></h2> <p>想在你的html中加一段引用吗?比如在你的网页的文章里想引用某个作家的一句诗,这样会使你的文章更加出彩,那么<q>标签是你所需要的。</p> <p>语法:<q>引用文本</q></p> <p>栗子: </p> <div class="code" style="position:relative; padding:0px; margin:0px;"><pre class='brush:php;toolbar:false;'><p>最初知道庄子,是从一首诗<q>庄生晓梦迷蝴蝶。望帝春心托杜鹃。</q>开始的。虽然当时不知道是什么意思,只是觉得诗句挺特别。后来才明白这个典故出自是庄子的《逍遥游》,《逍遥游》代表了庄子思想的最高境界,是对世俗社会的功名利禄及自己的舍弃。</p></pre><div class="contentsignin">登录后复制</div></div> <p>讲解: </p> <ol> <li><p>在上面的例子中,“庄生晓梦迷蝴蝶。望帝春心托杜鹃。” 这是一句诗歌,出自晚唐诗人李商隐的《锦瑟》 。因为不是作者自己的文字,所以需要使用实现引用。</p></li> <li><p>注意要引用的文本不用加双引号,浏览器会对q标签自动添加双引号。</p></li> </ol> <p>下图是代码显示结果:</p> <p> <p></p> </p> <p>注意这里用标签的真正关键点不是它的默认样式双引号(如果这样我们不如自己在键盘上输入双引号就行了),而是它的语义:引用别人的话。</p> <hr /> <h2 id="strong-blockquote-标签-长文本引用-strong"><strong><blockquote>标签,长文本引用</strong></h2> <p><blockquote>的作用也是引用别人的文本。但它是对长文本的引用,如在文章中引入大段某知名作家的文字,这时需要这个标签。等等,上一节<q>标签不是也是对文本的引用吗?不要忘记<q>标签是对简短文本的引用,比如说引用一句话就用到<q>标签。如想在我的文章中引用李白《关山月》中的诗句,因为引用文本比较长,所以使用<blockquote>。 </p> <p>语法:<blockquote>引用文本</blockquote>如下面例子:</p> <div class="code" style="position:relative; padding:0px; margin:0px;"><pre class='brush:php;toolbar:false;'><blockquote>明月出天山,苍茫云海间。长风几万里,吹度玉门关。汉下白登道,胡窥青海湾。由来征战地,不见有人还。 戍客望边色,思归多苦颜。高楼当此夜,叹息未应闲。</blockquote></pre><div class="contentsignin">登录后复制</div></div> <p>浏览器对<blockquote>标签的解析是缩进样式。如下图所示:</p> <p> <p></p> </p> <hr /> <h2 id="strong-使用-br-标签分行显示文本-strong"><strong>使用<br>标签分行显示文本</strong></h2> <p>例子,我们想让一首诗显示得更美观些,如显示下面效果:</p> <p> <p></p> </p> <p>怎么可以让每一句诗词后面加入一个折行呢?那就可以用到<br />标签了,在需要加回车换行的地方加入<br />,<br />标签作用相当于word文档中的回车。代码改为: </p> <div class="code" style="position:relative; padding:0px; margin:0px;"><pre class='brush:php;toolbar:false;'><h2 id="咏桂">《咏桂》</h2><p>暗淡轻黄体性柔,<br />情疏迹远只香留。<br />何须浅碧深红色,<br />自是花中第一流。</pre><div class="contentsignin">登录后复制</div></div> <p>诗文在浏览器中显示为:</p> <p> <p></p> </p> <hr /> <h2 id="strong-为你的网页中添加一些空格-strong"><strong>为你的网页中添加一些空格</strong></h2> <p>在html代码中输入空格、回车都是没有作用的。要想输入空格,必须写入。<strong>不要忘了那个分号</strong> </p> <p>在html代码中输入空格是不起作用的,如下代码。</p> <p> <p></p> </p> <p>在浏览中显示,还是没有空格效果。</p> <p> <p></p> </p> <p>输入空格的正确方法:</p> <p> <p></p> </p> <p>在浏览器中的显示出来的空格效果。如下图所示。</p> <p> <p></p> </p> <hr /> <h2 id="strong-认识-hr-标签-添加水平横线-strong"><strong>认识<hr>标签,添加水平横线</strong></h2> <p>在信息展示时,有时会需要加一些用于分隔的横线,这样会使文章看起来整齐些。如下图所示:</p> <p> <p></p> </p> <p>语法:</p> <ul> <li>html4.01版本 <hr></li> <li>xhtml1.0版本 <hr />注意:</li> <li><hr />标签和<br />标签一样也是一个空标签,所以只有一个开始标签,没有结束标签。</li> <li><hr />标签的在浏览器中的默认样式线条比较粗,颜色为灰色,可能有些人觉得这种样式不美观,没有关系,这些外在样式在我们以后学习了css样式表之后,都可以对其修改。</li> <li>大家注意,现在一般使用 xhtml1.0 的版本(其它标签也是),这种版本比较规范。</li> </ul> <hr /> <h2 id="strong-address-标签-为网页加入地址信息-strong"><strong><address>标签,为网页加入地址信息</strong></h2> <p>一般网页中会有一些网站的联系地址信息需要在网页中展示出来,这些联系地址信息如公司的地址就可以<address>标签。也可以定义一个地址(比如电子邮件地址)、签名或者文档的作者身份。栗子: </p> <div class="code" style="position:relative; padding:0px; margin:0px;"><pre class='brush:php;toolbar:false;'><address>本文的作者:<a href="mailto:zhaoliangsyn@163.com">zhaolion</a></address></pre><div class="contentsignin">登录后复制</div></div> <hr /> <h2 id="strong-想加入一行代码吗-使用-code-标签-strong"><strong>想加入一行代码吗?使用<code>标签</strong></h2> <p>在介绍语言技术的网站中,避免不了在网页中显示一些计算机专业的编程代码,当代码为一行代码时,你就可以使用<code>标签了,如下面例子: </p> <p><code>var i = a + b;</code> </p> <p>注意:在文章中一般如果要插入多行代码时不能使用<code>标签了。<strong>如果是多行代码,可以使用<div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:php;toolbar:false">标签</strong>。</p> <hr /> <h2 id="strong-使用-pre-标签为你的网页加入大段代码-strong"><strong>使用<pre class="brush:php;toolbar:false">标签为你的网页加入大段代码</strong></h2> <p>在上节中介绍加入一行代码的标签为<code>,但是在大多数情况下是需要加入大段代码的,如下图:</p> <p> <p></p> </p> <p>怎么办?不会是每一代码都加入一个<code>标签吧,没有这么复杂,这时候就可以使用<pre class="brush:php;toolbar:false">标签。 </p> <p>语法:<pre class="brush:php;toolbar:false">语言代码段</pre><div class="contentsignin">登录后复制</div></div></p> <p><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:php;toolbar:false">标签的主要作用:预格式化的文本。被包围在 pre 元素中的文本通常会保留空格和换行符。如下代码:</p> <pre class='brush:php;toolbar:false;'><pre class="brush:php;toolbar:false"> var message="欢迎"; for(var i=1;i<=10;i++) { alert(message); }</pre><div class="contentsignin">登录后复制</div></div></pre> <p>在浏览器中的显示结果为:</p> <p> <p></p> </p> <p>在上面的例子中可以看到代码中的空格,换行符都保留下来。如果用以前的方法,回车需要输入<br>签,空格需要输入 </p> <p>注意:<div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:php;toolbar:false"> 标签不只是为显示计算机的源代码时用的,在你需要在网页中预显示格式时都可以使用它,只是<pre class="brush:php;toolbar:false">标签的一个常见应用就是用来展示计算机的源代码。</p> <hr /> <h2 id="strong-使用-ul-添加新闻信息列表-strong"><strong>使用<ul>,添加新闻信息列表</strong></h2> <p>在浏览网页时,你会发现网页上有很多信息的列表,如新闻列表、图片列表,如下图所示。</p> <p> <p></p> </p> <p>这些列表就可以使用ul-li标签来完成。ul-li是 <strong>没有前后顺序的信息列表</strong>。</p> <p>语法: </p> <pre class='brush:php;toolbar:false;'><ul> <li>信息</li> <li>信息</li> ......</ul></pre><div class="contentsignin">登录后复制</div></div> <p>举例: </p> <div class="code" style="position:relative; padding:0px; margin:0px;"><pre class='brush:php;toolbar:false;'><ul> <li>精彩少年</li> <li>美丽突然出现</li> <li>触动心灵的旋律</li></ul></pre><div class="contentsignin">登录后复制</div></div> <p>ul-li在网页中显示的默认样式一般为:每项li前都自带一个圆点,如下图所示:</p> <p> <p></p> </p> <hr /> <h2 id="strong-使用-ol-添加顺序列表-strong"><strong>使用<ol>,添加顺序列表</strong></h2> <p>如果想在网页中展示有前后顺序的信息列表,怎么办呢?如,当当网上的书籍热卖排行榜,如下图所示。这类信息展示就可以使用<ol>标签来制作有序列表来展示。</p> <p> <p></p> </p> <p>语法:</p> <div class="code" style="position:relative; padding:0px; margin:0px;"><pre class='brush:php;toolbar:false;'><ol> <li>信息</li> <li>信息</li> ......</ol></pre><div class="contentsignin">登录后复制</div></div> <p>举例:</p> <p>下面是一个热点课程下载排行榜: </p> <div class="code" style="position:relative; padding:0px; margin:0px;"><pre class='brush:php;toolbar:false;'><ol> <li>前端开发面试心法 </li> <li>零基础学习html</li> <li>JavaScript全攻略</li></ol></pre><div class="contentsignin">登录后复制</div></div> <p><ol>在网页中显示的默认样式一般为:每项<li>前都自带一个序号,序号默认从1开始,如下图所示:</p> <p> <p></p> </p> <hr /> <h2 id="strong-初识div-strong"><strong>初识div</strong></h2> <h3 id="strong-认识div在排版中的作用-strong"><strong>认识div在排版中的作用</strong></h3> <p>在网页制作过程过中,可以把一些独立的逻辑部分划分出来,放在一个<div>标签中,这个<div>标签的作用就相当于一个容器。 </p> <p>语法:<div>…</div></p> <p>确定逻辑部分:什么是逻辑部分?它是页面上相互关联的一组元素。如网页中的独立的栏目版块,就是一个典型的逻辑部分。如下图所示:图中用红色边框标出的部分就是一个逻辑部分,就可以使用<div>标签作为容器。</p> <p> <p></p> </p> <h3 id="strong-给div命名-使逻辑更加清晰-strong"><strong>给div命名,使逻辑更加清晰</strong></h3> <p>在上一小节中,我们把一些标签放进<div>里,划分出一个独立的逻辑部分。为了使逻辑更加清晰,我们可以为这一个独立的逻辑部分设置一个名称,用id属性来为<div>提供唯一的名称,这个就像我们每个人都有一个身份证号,这个身份证号是唯一标识我们的身份的,也是必须唯一的。如下两图进行比较,如果设计师把两个图给你,哪个图你看上去能更快的理解呢?是不是右边的那幅图呢。</p> <p> <p></p> </p> <p>语法:<div id="版块名称">…</div></p> <hr /> <h2 id="strong-table标签-认识网页上的表格-strong"><strong>table标签,认识网页上的表格</strong></h2> <h3 id="strong-table标签-我们平时看到到表格-strong"><strong>table标签 = 我们平时看到到表格</strong></h3> <p>有时候我们需要在网页上展示一些数据,如某公司想在网页上展示公司的库存清单。如下表:</p> <p> <p></p> </p> <p>想在网页上展示上述表格效果可以使用以下代码:</p> <p> <p></p> </p> <p>创建表格的四个元素: table、tbody、tr、th、td</p> <ol> <li><p><table>…</table>:整个表格以<table>标记开始、</table>标记结束。</p></li> <li><p><tbody>…</tbody>:当表格内容非常多时,表格会下载一点显示一点,但如果加上<tbody>标签后,这个表格就要等表格内容全部下载完才会显示。</p></li> <li><p><tr>…</tr>:表格的一行,所以有几对tr 表格就有几行。</p></li> <li><p><td>…</td>:表格的一个单元格,一行中包含几对<td>...</td>,说明一行中就有几列。</p></li> <li><p><th>…</th>:表格的头部的一个单元格,表格表头。</p></li> <li><p>表格中列的个数,取决于一行中数据单元格的个数。 </p></li> </ol> <p>上述代码在浏览器中显示的默认的样式为:</p> <p> <p></p> </p> <p>总结:</p> <ol> <li><p>table表格在没有添加css样式之前,在浏览器中显示是没有表格线的</p></li> <li><p>表头,也就是th标签中的文本默认为粗体并且居中显示</p></li> </ol> <h3 id="strong-用css样式-为表格加入边框-strong"><strong>用css样式,为表格加入边框</strong></h3> <p>Table 表格在没有添加 css 样式之前,是没有边框的。这样不便于我们后期合并单元格知识点的讲解,所以在这一节中我们为表格添加一些样式,为它添加边框。代码中加入: </p> <div class="code" style="position:relative; padding:0px; margin:0px;"><pre class='brush:php;toolbar:false;'><style type="text/css">table tr td,th{border:1px solid #000;}</style></pre><div class="contentsignin">登录后复制</div></div> <p>上述代码是用 css 样式代码,为th,td单元格添加粗细为一个像素的黑色边框。</p> <p>结果窗口显示出结果样式:</p> <p> <p></p> </p> <h3 id="strong-caption标签-为表格添加标题和摘要-strong"><strong>caption标签,为表格添加标题和摘要</strong></h3> <p>表格还是需要添加一些标签进行优化,可以添加标题和摘要。代码如下 </p> <p> <p></p> </p> <p><strong>摘要</strong> 摘要的内容是不会在浏览器中显示出来的。它的作用是增加表格的可读性(语义化),使搜索引擎更好的读懂表格内容,还可以使屏幕阅读器更好的帮助特殊用户读取表格内容。语法:<table summary="表格简介文本"> </p> <p><strong>标题</strong> 用以描述表格内容,标题的显示位置:表格上方。语法:</p> <div class="code" style="position:relative; padding:0px; margin:0px;"><pre class='brush:php;toolbar:false;'><table> <caption>标题文本</caption> <tr> <td>…</td> <td>…</td> … </tr>…</table></pre><div class="contentsignin">登录后复制</div></div> <hr /> <h2 id="strong-初识-a-标签-strong"><strong>初识<a>标签</strong></h2> <h3 id="strong-使用-a-标签-链接到另一个页面-strong"><strong>使用<a>标签,链接到另一个页面</strong></h3> <p>使用<a>标签可实现超链接,它在网页制作中可以说是无处不在,只要有链接的地方,就会有这个标签。 </p> <p>语法 :<a href="目标网址" title="鼠标滑过显示的文本">链接显示的文本</a> </p> <p>例如:<a href="http://www.zhaolion.com" title="点击进入我的博客">click here!</a></p> <p>上面例子作用是单击click here!文字,网页链接到http://www.zhaolion.com这个网页。 </p> <p>title属性的作用,鼠标滑过链接文字时会显示这个属性的文本内容。这个属性在实际网页开发中作用很大,主要方便搜索引擎了解链接地址的内容(语义化更友好)<strong>提醒</strong>还有一个有趣的现象不知道小伙伴们发现了没有,只要为文本加入a标签后,文字的颜色就会自动变为蓝色(被点击过的文本颜色为紫色),颜色很难看吧,不过没有关系后面我们学习了css样子就可以设置过来(a{color:#000}),后面会详细讲解。</p> <h3 id="strong-在新建浏览器窗口中打开链接-strong"><strong>在新建浏览器窗口中打开链接</strong></h3> <p><a>标签在默认情况下,链接的网页是在当前浏览器窗口中打开,有时我们需要在新的浏览器窗口中打开。只需要添加一个属性 target="_blank"如下代码:<a href="目标网址" target="_blank">click here!</a> </p> <h3 id="strong-使用mailto在网页中链接Email地址-strong"><strong>使用mailto在网页中链接Email地址</strong></h3> <p><a>标签还有一个作用是可以链接Email地址,使用mailto能让访问者便捷向网站管理者发送电子邮件。我们还可以利用mailto做许多其它事情。下面一一进行讲解,请看详细图示:</p> <p> <p></p> </p> <p><strong>提醒</strong>:如果mailto后面同时有多个参数的话,第一个参数必须以“?”开头,后面的参数每一个都以“&”分隔。下面是一个完整的实例: 在浏览器中显示的一个发送按钮</p> <p> <p></p> </p> <p>点击链接会打开电子邮件应用,并自动填写收件人等设置好的信息,如下图:</p> <p> <p></p> </p> <hr /> <h2 id="strong-认识-img-alt-HTML-入门笔记-初识HTML-html-css-WEB-ITnose-标签-为网页插入图片-strong"><strong>认识<img alt="HTML 入门笔记 - 初识HTML_html/css_WEB-ITnose" >标签,为网页插入图片</strong></h2> <p>在网页的制作中为使网页炫丽美观,肯定是缺少不了图片,可以使用<img alt="HTML 入门笔记 - 初识HTML_html/css_WEB-ITnose" >标签来插入图片。语法: [站外图片上传中……(48)] </p> <p>举例: <img src = "myimage.gif" alt = "My Image" title = "My Image" /> </p> <p>讲解:</p> <ol> <li><p>src:标识图像的位置;</p></li> <li><p>alt:指定图像的描述性文本,当图像不可见时(下载不成功时),可看到该属性指定的文本;</p></li> <li><p>title:提供在图像可见时对图像的描述(鼠标滑过图片时显示的文本);</p></li> <li><p>图像可以是GIF,PNG,JPEG格式的图像文件。 </p></li> </ol> <hr /> <h2 id="strong-认识表单-strong"><strong>认识表单</strong></h2> <h3 id="strong-使用表单标签-与用户交互-strong"><strong>使用表单标签,与用户交互</strong></h3> <p>网站怎样与用户进行交互?答案是使用HTML表单(form)。表单是可以把浏览者输入的数据传送到服务器端,这样服务器端程序就可以处理表单传过来的数据。 </p> <p>语法: <form method="传送方式" action="服务器文件"> </p> <p>讲解:</p> <ol> <li><p><form> :<form>标签是成对出现的,以<form>开始,以</form>结束。</p></li> <li><p>action :浏览者输入的数据被传送到的地方,比如一个PHP页面(save.php)。</p></li> <li><p>method : 数据传送的方式(get/post)。</p><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class='brush:php;toolbar:false;'><form method="post" action="save.php"> <label for="username">用户名:</label> <input type="text" name="username" /> <label for="pass">密码:</label> <input type="password" name="pass" /></form></pre><div class="contentsignin">登录后复制</div></div></li> </ol> <p><strong>注意</strong> </p> <ol> <li><p>所有表单控件(文本框、文本域、按钮、单选框、复选框等)都必须放在<form></form>标签之间(否则用户输入的信息可提交不到服务器上哦!)。</p></li> <li><p>method:post/get的区别这一部分内容属于后端程序员考虑的问题。感兴趣的小伙伴可以问谷哥 </p></li> </ol> <h3 id="strong-文本输入框-密码输入框-strong"><strong>文本输入框、密码输入框</strong></h3> <p>当用户要在表单中键入字母、数字等内容时,就会用到文本输入框。文本框也可以转化为密码输入框。</p> <p>语法:</p> <div class="code" style="position:relative; padding:0px; margin:0px;"><pre class='brush:php;toolbar:false;'><form> <input type="text/password" name="名称" value="文本" /></form></pre><div class="contentsignin">登录后复制</div></div> <ol> <li><p>type:</p> <ul> <li>当type="text"时,输入框为文本输入框;</li> <li>当type="password"时, 输入框为密码输入框。</li> </ul></li> <li><p>name:为文本框命名,以备后台程序ASP 、PHP使用。</p></li> <li><p>value:为文本输入框设置默认值。(一般起到提示作用)</p></li> </ol> <p>举例:</p> <div class="code" style="position:relative; padding:0px; margin:0px;"><pre class='brush:php;toolbar:false;'><form> 姓名: <input type="text" name="myName"> <br/> 密码: <input type="password" name="pass"></form></pre><div class="contentsignin">登录后复制</div></div> <p>在浏览器中显示的结果:</p> <p> <p></p> </p> <h3 id="strong-文本域-支持多行文本输入-strong"><strong>文本域,支持多行文本输入</strong></h3> <p>当用户需要在表单中输入大段文字时,需要用到文本输入域。 </p> <p>语法: <textarea rows="行数" cols="列数">文本</textarea> </p> <ol> <li><p><textarea>标签是成对出现的,以<textarea>开始,以</textarea>结束。</p></li> <li><p>cols :多行输入域的列数。</p></li> <li><p>rows :多行输入域的行数。</p></li> <li><p>在<textarea></textarea>标签之间可以输入默认值。</p></li> </ol> <p>举例: </p> <div class="code" style="position:relative; padding:0px; margin:0px;"><pre class='brush:php;toolbar:false;'><form method="post" action="save.php"> <label>联系我们</label> <textarea cols="50" rows="10" >在这里输入内容...</textarea></form></pre><div class="contentsignin">登录后复制</div></div> <p>在浏览器中显示结果:</p> <p> <p></p> </p> <h3 id="strong-使用单选框-复选框-让用户选择-strong"><strong>使用单选框、复选框,让用户选择</strong></h3> <p>在使用表单设计调查表时,为了减少用户的操作,使用选择框是一个好主意,html中有两种选择框,即单选框和复选框,两者的区别是单选框中的选项用户只能选择一项,而复选框中用户可以任意选择多项,甚至全选。请看下面的例子:语法: <input type="radio/checkbox" value="值" name="名称" checked="checked"/></p> <ol> <li><p>type:</p> <ul> <li><p>当 type="radio" 时,控件为单选框</p></li> <li><p>当 type="checkbox" 时,控件为复选框</p></li> </ul></li> <li><p>value:提交数据到服务器的值(后台程序PHP使用)</p></li> <li><p>name:为控件命名,以备后台程序 ASP、PHP 使用</p></li> <li><p>checked:当设置 checked="checked" 时,该选项被默认选中</p></li> </ol> <p>如下面代码:</p> <p> <p></p> </p> <p>在浏览器中显示的结果:</p> <p> <p></p> </p> <p><strong>注意</strong>:同一组的单选按钮,name 取值一定要一致,比如上面例子为同一个名称“radioLove”,这样同一组的单选按钮才可以起到单选的作用。</p> <h3 id="strong-使用下拉列表框-节省空间-strong"><strong>使用下拉列表框,节省空间</strong></h3> <p>下拉列表在网页中也常会用到,它可以有效的节省网页空间。既可以单选、又可以多选。如下代码:</p> <p> <p></p> </p> <p>讲解:</p> <ol> <li>value: <p> <p></p> </p> </li> <li>selected="selected":设置selected="selected"属性,则该选项就被默认选中。</li> </ol> <h3 id="strong-使用下拉列表框进行多选-strong"><strong>使用下拉列表框进行多选</strong></h3> <p>下拉列表也可以进行多选操作,在<select>标签中设置multiple="multiple"属性,就可以实现多选功能,在 widows 操作系统下,进行多选时按下Ctrl键同时进行单击(在 Mac下使用 Command +单击),可以选择多个选项。如下代码:</p> <p> <p></p> </p> <p>在浏览器中显示的结果:</p> <p> <p></p> </p> <h3 id="strong-使用提交按钮-提交数据-strong"><strong>使用提交按钮,提交数据</strong></h3> <p>在表单中有两种按钮可以使用,分别为:提交按钮、重置。这一小节讲解提交按钮:当用户需要提交表单信息到服务器时,需要用到提交按钮。语法: <input type="submit" value="提交"> </p> <ol> <li>type:只有当type值设置为submit时,按钮才有提交作用</li> <li>value:按钮上显示的文字 </li> </ol> <p>举例:</p> <p> <p></p> </p> <p>在浏览器中显示的结果:</p> <p> <p></p> </p> <h3 id="strong-使用重置按钮-重置表单信息-strong"><strong>使用重置按钮,重置表单信息</strong></h3> <p>当用户需要重置表单信息到初始时的状态时,比如用户输入“用户名”后,发现书写有误,可以使用重置按钮使输入框恢复到初始状态。只需要把type设置为"reset"就可以。语法: <input type="reset" value="重置"> </p> <ol> <li>type:只有当type值设置为reset时,按钮才有重置作用 </li> <li>value:按钮上显示的文字 </li> </ol> <p>举例: </p> <p> <p></p> </p> <p>在浏览器中显示的结果:输入账号</p> <p> <p></p> </p> <p>单击重置按钮</p> <p> <p></p> </p> <h3 id="strong-form表单中的label标签-strong"><strong>form表单中的label标签</strong></h3> <p>小伙伴们,你们在前面学习表单各种控件的时候,有没有发现一个标签--label,这一小节就来揭晓它的作用。label标签不会向用户呈现任何特殊效果,它的作用是为鼠标用户改进了可用性。如果你在 label 标签内点击文本,就会触发此控件。就是说,当用户单击选中该label标签时,浏览器就会自动将焦点转到和标签相关的表单控件上(就自动选中和该label标签相关连的表单控件上)。语法: <label for="控件id名称"><strong>注意</strong> 标签的 for 属性中的值应当与相关控件的 id 属性值一定要相同。 <strong>这样你会在点慢跑标签,即使没有点checkbox 也能选中</strong>例子:</p> <div class="code" style="position:relative; padding:0px; margin:0px;"><pre class='brush:php;toolbar:false;'><form> <a>你对什么运动感兴趣:</a> <br /> <label for="1">慢跑</label><input type="checkbox" name="manpao" id="1"><br /> <label for="2">登山</label><input type="checkbox" name="dengshan" id="2"><br /> <label for="3">篮球</label><input type="checkbox" name="lanqiu" id="3"><br /></form></pre><div class="contentsignin">登录后复制</div></div> </div> </div> <div class="wzconShengming_sp"> <div class="bzsmdiv_sp">本站声明</div> <div>本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn</div> </div> </div> <ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-5902227090019525" data-ad-slot="2507867629"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> <div class="AI_ToolDetails_main4sR"> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-5902227090019525" data-ad-slot="3653428331" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> <!-- <div class="phpgenera_Details_mainR4"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hotarticle2.png" alt="" /> <h2>热门文章</h2> </div> <div class="phpgenera_Details_mainR4_bottom"> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/zh/faq/1796780570.html" title="R.E.P.O.能量晶体解释及其做什么(黄色晶体)" class="phpgenera_Details_mainR4_bottom_title">R.E.P.O.能量晶体解释及其做什么(黄色晶体)</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3 周前</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/zh/faq/1796780641.html" title="R.E.P.O.最佳图形设置" class="phpgenera_Details_mainR4_bottom_title">R.E.P.O.最佳图形设置</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3 周前</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/zh/faq/1796785841.html" title="刺客信条阴影:贝壳谜语解决方案" class="phpgenera_Details_mainR4_bottom_title">刺客信条阴影:贝壳谜语解决方案</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>2 周前</span> <span>By DDD</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/zh/faq/1796780520.html" title="R.E.P.O.如果您听不到任何人,如何修复音频" class="phpgenera_Details_mainR4_bottom_title">R.E.P.O.如果您听不到任何人,如何修复音频</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3 周前</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/zh/faq/1796779766.html" title="WWE 2K25:如何解锁Myrise中的所有内容" class="phpgenera_Details_mainR4_bottom_title">WWE 2K25:如何解锁Myrise中的所有内容</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>4 周前</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/zh/article.html">显示更多</a> </div> </div> </div> --> <div class="phpgenera_Details_mainR3"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hottools2.png" alt="" /> <h2>热AI工具</h2> </div> <div class="phpgenera_Details_mainR3_bottom"> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/zh/ai/undresserai-undress" title="Undresser.AI Undress" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411540686492.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Undresser.AI Undress" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/zh/ai/undresserai-undress" title="Undresser.AI Undress" class="phpmain_tab2_mids_title"> <h3>Undresser.AI Undress</h3> </a> <p>人工智能驱动的应用程序,用于创建逼真的裸体照片</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/zh/ai/ai-clothes-remover" title="AI Clothes Remover" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411552797167.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="AI Clothes Remover" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/zh/ai/ai-clothes-remover" title="AI Clothes Remover" class="phpmain_tab2_mids_title"> <h3>AI Clothes Remover</h3> </a> <p>用于从照片中去除衣服的在线人工智能工具。</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/zh/ai/undress-ai-tool" title="Undress AI Tool" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173410641626608.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Undress AI Tool" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/zh/ai/undress-ai-tool" title="Undress AI Tool" class="phpmain_tab2_mids_title"> <h3>Undress AI Tool</h3> </a> <p>免费脱衣服图片</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/zh/ai/clothoffio" title="Clothoff.io" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411529149311.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Clothoff.io" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/zh/ai/clothoffio" title="Clothoff.io" class="phpmain_tab2_mids_title"> <h3>Clothoff.io</h3> </a> <p>AI脱衣机</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/zh/ai/ai-hentai-generator" title="AI Hentai Generator" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173405034393877.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="AI Hentai Generator" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/zh/ai/ai-hentai-generator" title="AI Hentai Generator" class="phpmain_tab2_mids_title"> <h3>AI Hentai Generator</h3> </a> <p>免费生成ai无尽的。</p> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/zh/ai">显示更多</a> </div> </div> </div> <script src="https://sw.php.cn/hezuo/cac1399ab368127f9b113b14eb3316d0.js" type="text/javascript"></script> <div class="phpgenera_Details_mainR4"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hotarticle2.png" alt="" /> <h2>热门文章</h2> </div> <div class="phpgenera_Details_mainR4_bottom"> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/zh/faq/1796780570.html" title="R.E.P.O.能量晶体解释及其做什么(黄色晶体)" class="phpgenera_Details_mainR4_bottom_title">R.E.P.O.能量晶体解释及其做什么(黄色晶体)</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3 周前</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/zh/faq/1796780641.html" title="R.E.P.O.最佳图形设置" class="phpgenera_Details_mainR4_bottom_title">R.E.P.O.最佳图形设置</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3 周前</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/zh/faq/1796785841.html" title="刺客信条阴影:贝壳谜语解决方案" class="phpgenera_Details_mainR4_bottom_title">刺客信条阴影:贝壳谜语解决方案</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>2 周前</span> <span>By DDD</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/zh/faq/1796780520.html" title="R.E.P.O.如果您听不到任何人,如何修复音频" class="phpgenera_Details_mainR4_bottom_title">R.E.P.O.如果您听不到任何人,如何修复音频</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3 周前</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/zh/faq/1796779766.html" title="WWE 2K25:如何解锁Myrise中的所有内容" class="phpgenera_Details_mainR4_bottom_title">WWE 2K25:如何解锁Myrise中的所有内容</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>4 周前</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/zh/article.html">显示更多</a> </div> </div> </div> <div class="phpgenera_Details_mainR3"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hottools2.png" alt="" /> <h2>热工具</h2> </div> <div class="phpgenera_Details_mainR3_bottom"> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/zh/toolset/development-tools/92" title="记事本++7.3.1" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58ab96f0f39f7357.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="记事本++7.3.1" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/zh/toolset/development-tools/92" title="记事本++7.3.1" class="phpmain_tab2_mids_title"> <h3>记事本++7.3.1</h3> </a> <p>好用且免费的代码编辑器</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/zh/toolset/development-tools/93" title="SublimeText3汉化版" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58ab97a3baad9677.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="SublimeText3汉化版" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/zh/toolset/development-tools/93" title="SublimeText3汉化版" class="phpmain_tab2_mids_title"> <h3>SublimeText3汉化版</h3> </a> <p>中文版,非常好用</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/zh/toolset/development-tools/121" title="禅工作室 13.0.1" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58ab97ecd1ab2670.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="禅工作室 13.0.1" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/zh/toolset/development-tools/121" title="禅工作室 13.0.1" class="phpmain_tab2_mids_title"> <h3>禅工作室 13.0.1</h3> </a> <p>功能强大的PHP集成开发环境</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/zh/toolset/development-tools/469" title="Dreamweaver CS6" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58d0e0fc74683535.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="Dreamweaver CS6" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/zh/toolset/development-tools/469" title="Dreamweaver CS6" class="phpmain_tab2_mids_title"> <h3>Dreamweaver CS6</h3> </a> <p>视觉化网页开发工具</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/zh/toolset/development-tools/500" title="SublimeText3 Mac版" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58d34035e2757995.png?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="SublimeText3 Mac版" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/zh/toolset/development-tools/500" title="SublimeText3 Mac版" class="phpmain_tab2_mids_title"> <h3>SublimeText3 Mac版</h3> </a> <p>神级代码编辑软件(SublimeText3)</p> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/zh/ai">显示更多</a> </div> </div> </div> <div class="phpgenera_Details_mainR4"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hotarticle2.png" alt="" /> <h2>热门话题</h2> </div> <div class="phpgenera_Details_mainR4_bottom"> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/zh/faq/gmailyxdlrkzn" title="gmail邮箱登陆入口在哪里" class="phpgenera_Details_mainR4_bottom_title">gmail邮箱登陆入口在哪里</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>7469</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>15</span> </div> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/zh/faq/cakephp-tutor" title="CakePHP 教程" class="phpgenera_Details_mainR4_bottom_title">CakePHP 教程</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>1376</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>52</span> </div> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/zh/faq/steamdzhmcssmgs" title="steam的账户名称是什么格式" class="phpgenera_Details_mainR4_bottom_title">steam的账户名称是什么格式</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>77</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>11</span> </div> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/zh/faq/winactivationkeyper" title="win11激活密钥永久" class="phpgenera_Details_mainR4_bottom_title">win11激活密钥永久</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>48</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>19</span> </div> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/zh/faq/newyorktimesdailybrief" title="NYT连接提示和答案" class="phpgenera_Details_mainR4_bottom_title">NYT连接提示和答案</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>19</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>29</span> </div> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/zh/faq/zt">显示更多</a> </div> </div> </div> </div> </div> <div class="Article_Details_main2"> <div class="phpgenera_Details_mainL4"> <div class="phpmain1_2_top"> <a href="javascript:void(0);" class="phpmain1_2_top_title">Related knowledge<img src="/static/imghw/index2_title2.png" alt="" /></a> </div> <div class="phpgenera_Details_mainL4_info"> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/zh/faq/1796782759.html" title="&gt; gt;的目的是什么 元素?" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/202503/21/2025032112342868456.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="&gt; gt;的目的是什么 元素?" /> </a> <a href="https://www.php.cn/zh/faq/1796782759.html" title="&gt; gt;的目的是什么 元素?" class="phphistorical_Version2_mids_title">&gt; gt;的目的是什么 元素?</a> <span class="Articlelist_txts_time">Mar 21, 2025 pm 12:34 PM</span> <p class="Articlelist_txts_p">本文讨论了HTML&lt; Progress&gt;元素,其目的,样式和与&lt; meter&gt;元素。主要重点是使用&lt; progress&gt;为了完成任务和LT;仪表&gt;对于stati</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/zh/faq/1796782758.html" title="&lt; datalist&gt;的目的是什么。 元素?" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/202503/21/2025032112332857446.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="&lt; datalist&gt;的目的是什么。 元素?" /> </a> <a href="https://www.php.cn/zh/faq/1796782758.html" title="&lt; datalist&gt;的目的是什么。 元素?" class="phphistorical_Version2_mids_title">&lt; datalist&gt;的目的是什么。 元素?</a> <span class="Articlelist_txts_time">Mar 21, 2025 pm 12:33 PM</span> <p class="Articlelist_txts_p">本文讨论了html&lt; datalist&gt;元素,通过提供自动完整建议,改善用户体验并减少错误来增强表格。Character计数:159</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/zh/faq/1796780220.html" title="HTML5中跨浏览器兼容性的最佳实践是什么?" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/202503/17/2025031712203454598.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="HTML5中跨浏览器兼容性的最佳实践是什么?" /> </a> <a href="https://www.php.cn/zh/faq/1796780220.html" title="HTML5中跨浏览器兼容性的最佳实践是什么?" class="phphistorical_Version2_mids_title">HTML5中跨浏览器兼容性的最佳实践是什么?</a> <span class="Articlelist_txts_time">Mar 17, 2025 pm 12:20 PM</span> <p class="Articlelist_txts_p">文章讨论了确保HTML5跨浏览器兼容性的最佳实践,重点是特征检测,进行性增强和测试方法。</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/zh/faq/1796782760.html" title="&lt; meter&gt;的目的是什么。 元素?" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/202503/21/2025032112352661331.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="&lt; meter&gt;的目的是什么。 元素?" /> </a> <a href="https://www.php.cn/zh/faq/1796782760.html" title="&lt; meter&gt;的目的是什么。 元素?" class="phphistorical_Version2_mids_title">&lt; meter&gt;的目的是什么。 元素?</a> <span class="Articlelist_txts_time">Mar 21, 2025 pm 12:35 PM</span> <p class="Articlelist_txts_p">本文讨论了HTML&lt; meter&gt;元素,用于在一个范围内显示标量或分数值及其在Web开发中的常见应用。它区分了&lt; meter&gt;从&lt; progress&gt;和前</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/zh/faq/1796778165.html" title="我如何使用html5&lt; time&gt; 元素以语义表示日期和时间?" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/202503/12/2025031216051550326.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="我如何使用html5&lt; time&gt; 元素以语义表示日期和时间?" /> </a> <a href="https://www.php.cn/zh/faq/1796778165.html" title="我如何使用html5&lt; time&gt; 元素以语义表示日期和时间?" class="phphistorical_Version2_mids_title">我如何使用html5&lt; time&gt; 元素以语义表示日期和时间?</a> <span class="Articlelist_txts_time">Mar 12, 2025 pm 04:05 PM</span> <p class="Articlelist_txts_p">本文解释了HTML5&lt; time&gt;语义日期/时间表示的元素。 它强调了DateTime属性对机器可读性(ISO 8601格式)的重要性,并在人类可读文本旁边,增强Accessibilit</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/zh/faq/1796780224.html" title="如何使用HTML5表单验证属性来验证用户输入?" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/202503/17/2025031712273147081.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="如何使用HTML5表单验证属性来验证用户输入?" /> </a> <a href="https://www.php.cn/zh/faq/1796780224.html" title="如何使用HTML5表单验证属性来验证用户输入?" class="phphistorical_Version2_mids_title">如何使用HTML5表单验证属性来验证用户输入?</a> <span class="Articlelist_txts_time">Mar 17, 2025 pm 12:27 PM</span> <p class="Articlelist_txts_p">本文讨论了使用HTML5表单验证属性,例如必需的,图案,最小,最大和长度限制,以直接在浏览器中验证用户输入。</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/zh/faq/1796782305.html" title="视口元标签是什么?为什么对响应式设计很重要?" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/202503/20/2025032017560614263.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="视口元标签是什么?为什么对响应式设计很重要?" /> </a> <a href="https://www.php.cn/zh/faq/1796782305.html" title="视口元标签是什么?为什么对响应式设计很重要?" class="phphistorical_Version2_mids_title">视口元标签是什么?为什么对响应式设计很重要?</a> <span class="Articlelist_txts_time">Mar 20, 2025 pm 05:56 PM</span> <p class="Articlelist_txts_p">本文讨论了视口元标签,这对于移动设备上的响应式Web设计至关重要。它解释了如何正确使用确保最佳的内容缩放和用户交互,而滥用可能会导致设计和可访问性问题。</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/zh/faq/1796782318.html" title="&lt; iframe&gt;的目的是什么。 标签?使用时的安全考虑是什么?" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/202503/20/2025032018054766795.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="&lt; iframe&gt;的目的是什么。 标签?使用时的安全考虑是什么?" /> </a> <a href="https://www.php.cn/zh/faq/1796782318.html" title="&lt; iframe&gt;的目的是什么。 标签?使用时的安全考虑是什么?" class="phphistorical_Version2_mids_title">&lt; iframe&gt;的目的是什么。 标签?使用时的安全考虑是什么?</a> <span class="Articlelist_txts_time">Mar 20, 2025 pm 06:05 PM</span> <p class="Articlelist_txts_p">本文讨论了&lt; iframe&gt;将外部内容嵌入网页,其常见用途,安全风险以及诸如对象标签和API等替代方案的目的。</p> </div> </div> <a href="https://www.php.cn/zh/web-designer.html" class="phpgenera_Details_mainL4_botton"> <span>See all articles</span> <img src="/static/imghw/down_right.png" alt="" /> </a> </div> </div> </div> </main> <footer> <div class="footer"> <div class="footertop"> <img src="/static/imghw/logo.png" alt=""> <p>公益在线PHP培训,帮助PHP学习者快速成长!</p> </div> <div class="footermid"> <a href="https://www.php.cn/zh/about/us.html">关于我们</a> <a href="https://www.php.cn/zh/about/disclaimer.html">免责声明</a> <a href="https://www.php.cn/zh/update/article_0_1.html">Sitemap</a> </div> <div class="footerbottom"> <p> © php.cn All rights reserved </p> </div> </div> </footer> <input type="hidden" id="verifycode" value="/captcha.html"> <script>layui.use(['element', 'carousel'], function () {var element = layui.element;$ = layui.jquery;var carousel = layui.carousel;carousel.render({elem: '#test1', width: '100%', height: '330px', arrow: 'always'});$.getScript('/static/js/jquery.lazyload.min.js', function () {$("img").lazyload({placeholder: "/static/images/load.jpg", effect: "fadeIn", threshold: 200, skip_invisible: false});});});</script> <script src="/static/js/common_new.js"></script> <script type="text/javascript" src="/static/js/jquery.cookie.js?1744438771"></script> <script src="https://vdse.bdstatic.com//search-video.v1.min.js"></script> <link rel='stylesheet' id='_main-css' href='/static/css/viewer.min.css?2' type='text/css' media='all' /> <script type='text/javascript' src='/static/js/viewer.min.js?1'></script> <script type='text/javascript' src='/static/js/jquery-viewer.min.js'></script> <script type="text/javascript" src="/static/js/global.min.js?5.5.53"></script> <script> var _paq = window._paq = window._paq || []; /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function () { var u = "https://tongji.php.cn/"; _paq.push(['setTrackerUrl', u + 'matomo.php']); _paq.push(['setSiteId', '9']); var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0]; g.async = true; g.src = u + 'matomo.js'; s.parentNode.insertBefore(g, s); })(); </script> <script> // top layui.use(function () { var util = layui.util; util.fixbar({ on: { mouseenter: function (type) { layer.tips(type, this, { tips: 4, fixed: true, }); }, mouseleave: function (type) { layer.closeAll("tips"); }, }, }); }); document.addEventListener("DOMContentLoaded", (event) => { // 定义一个函数来处理滚动链接的点击事件 function setupScrollLink(scrollLinkId, targetElementId) { const scrollLink = document.getElementById(scrollLinkId); const targetElement = document.getElementById(targetElementId); if (scrollLink && targetElement) { scrollLink.addEventListener("click", (e) => { e.preventDefault(); // 阻止默认链接行为 targetElement.scrollIntoView({ behavior: "smooth" }); // 平滑滚动到目标元素 }); } else { console.warn( `Either scroll link with ID '${scrollLinkId}' or target element with ID '${targetElementId}' not found.` ); } } // 使用该函数设置多个滚动链接 setupScrollLink("Article_Details_main1L2s_1", "article_main_title1"); setupScrollLink("Article_Details_main1L2s_2", "article_main_title2"); setupScrollLink("Article_Details_main1L2s_3", "article_main_title3"); setupScrollLink("Article_Details_main1L2s_4", "article_main_title4"); setupScrollLink("Article_Details_main1L2s_5", "article_main_title5"); setupScrollLink("Article_Details_main1L2s_6", "article_main_title6"); // 可以继续添加更多的滚动链接设置 }); window.addEventListener("scroll", function () { var fixedElement = document.getElementById("Article_Details_main1Lmain"); var scrollTop = window.scrollY || document.documentElement.scrollTop; // 兼容不同浏览器 var clientHeight = window.innerHeight || document.documentElement.clientHeight; // 视口高度 var scrollHeight = document.documentElement.scrollHeight; // 页面总高度 // 计算距离底部的距离 var distanceToBottom = scrollHeight - scrollTop - clientHeight; // 当距离底部小于或等于300px时,取消固定定位 if (distanceToBottom <= 980) { fixedElement.classList.remove("Article_Details_main1Lmain"); fixedElement.classList.add("Article_Details_main1Lmain_relative"); } else { // 否则,保持固定定位 fixedElement.classList.remove("Article_Details_main1Lmain_relative"); fixedElement.classList.add("Article_Details_main1Lmain"); } }); </script> </body> </html>