HTML is the carrier of web content. Content is the information that web page producers put on the page for users to browse. It can include text, pictures, videos, etc. HTML tags are combined into various web pages. Let’s talk about some commonly used tags, which is also a summary of the knowledge learned. . .
* is called the root tag, and all web page tags are in .
* The
tag is used to define the head of the document, which is a container for all head elements. Header elements include
, <script>, <style>, <link>, <meta> and other tags. <br /> * The content between the <body> and tags is the main content of the webpage, such as <h1>, <p>, <a>, <img src="/static/imghwm/default1.png" data-src="图片地址" class="lazy" alt="Tags commonly used in Html_html/css_WEB-ITnose" > and other webpage content tags. The content in the tags here will be displayed in the browser. <p> *<p>Paragraph text The default style of the <p> tag will have white space before and after the paragraph. <p> * There are 6 title tags in total. h1, h2, h3, h4, h5, and h6 are the first-level heading, the second-level heading, the third-level heading, the fourth-level heading, the fifth-level heading, and the sixth-level heading respectively. . And in descending order of importance. <h1> is the highest level. <p> * If you want to emphasize certain words in a paragraph, you can use the <em> or <strong> tags. But there is a difference in the tone of emphasis: <em> means emphasis, <strong> means stronger emphasis. And in browsers, <em> is expressed in italics by default, and <strong> is expressed in bold. Compared with the two tags, domestic front-end programmers currently prefer to use <strong> to express emphasis. <p> * The <span> tag has no semantics. Its function is to set a separate style. <p> *<q>Quote text tag, the real key point of the <q> tag is not its default style double quotes (in this case we might as well enter the double quotes on the keyboard ourselves) ), but its semantics: quoting someone else's words. <p> *<blockquote> is also used to quote other people’s text. But it is a reference to a long text, such as introducing a large section of a well-known writer's text into an article, in which case this tag is needed. <p> *<br/>Newline tag in html. <p> *<hr />Horizontal divider. <p> *<address> The address written in the middle will be italicized and line-wrapped when displayed in the browser. <p> *<code>code text -- Define computer code text. <br /> *<pre class="brush:php;toolbar:false">Multi-line code text -- A common application of tags is to represent computer source code. Spaces and carriage returns are usually reserved inside this tag; tags that cause paragraph breaks cannot exist inside this tag, such as <p>, <address>, etc. <p> *<ul> <pre class='brush:php;toolbar:false;'> <li>信息</li> <li>信息</li> ...... </ul> ul-li是没有前后顺序的信息列表标签。ul-li在网页中显示的默认样式一般为:每项li前都自带一个圆点。 *<ol></pre> <pre class='brush:php;toolbar:false;'> <li>信息</li> <li>信息</li> ...... </ol> <ol><li></li></ol>,有序标签,相比<ul>,菜单格式添加数字显示. *<div>…</div>,在网页制作过程过中,可以把一些独立的逻辑部分划分出来,放在一个<div>标签中,这个<div>标签的作用就相当于一个容器。用id属性来为<div>提供唯一的名称,这个就像我们每个人都有一个身份证号,这个身份证号是唯一标识我们的身份的,也是必须唯一的。 *创建表格的四个元素: table、tbody、tr、th、td 1、<table>…</table>:整个表格以<table>标记开始、</table>标记结束。 2、<tbody>…</tbody>:当表格内容非常多时,表格会下载一点显示一点,但如果加上<tbody>标签后,这个表格就要等表格内容全部下载完才会显示。如右侧代码编辑器中的代码。 3、<tr>…</tr>:表格的一行,所以有几对tr 表格就有几行。 4、<td>…</td>:表格的一个单元格,一行中包含几对<td>...</td>,说明一行中就有几列。 5、<th>…</th>:表格的头部的一个单元格,表格表头。 6、表格中列的个数,取决于一行中数据单元格的个数。 *<table summary="摘要"> <caption>表格标题</caption>:位置落于整个表格的正上方,居中 </table> *<a>超链接标签,<a href="目标网址" title="鼠标滑过显示的文本">链接显示的文本</a>。 *<a>标签使用mailto可以连接邮箱地址,方便向管理者发送邮件。参数,mailto:邮箱地址;cc=抄送地址;bcc=密送地址;subject=添加邮件主题;body=添加邮件内容【多个收件人之间用“;”分隔;mailto多个参数后面第一参数用“?”分隔,后面的参数每一个都以“&”分隔。】例:<a href="mailto:yy@imooc.com?subject=观了不起的盖茨比有感&body=你好,对此评论有些想法。">对此影评有何感想,发送邮件给我</a>。 *<img src="/static/imghwm/default1.png" data-src="图片地址" class="lazy" alt="下载失败时的替换文本" title = "提示文本"> 1、src:标识图像的位置; 2、alt:指定图像的描述性文本,当图像不可见时(下载不成功时),可看到该属性指定的文本; 3、title:提供在图像可见时对图像的描述(鼠标滑过图片时显示的文本); 4、图像可以是GIF,PNG,JPEG格式的图像文件; *使用表单标签,与用户交互<form> ...</form> 语法:<form method="传送方式" action="服务器文件"> 1.<form> :<form>标签是成对出现的,以<form>开始,以</form>结束。 2.action :浏览者输入的数据被传送到的地方,比如一个PHP页面(save.php)。 3.method : 数据传送的方式(get/post)。 注意: 1、所有表单控件(文本框、文本域、按钮、单选框、复选框等)都必须放在<form></form>标签之间(否则用户输入的信息可提交不到服务器上哦!)。 *<form> <input type="text/password" name="名称" value="文本" /> "input"是单标签,所以后面有个/ </form> 1、type: 当type="text"时,输入框为文本输入框; 当type="password"时, 输入框为密码输入框。 2、name:为文本框命名,以备后台程序ASP 、PHP使用。 3、value:为文本输入框设置默认值。(一般起到提示作用)。 *当用户需要在表单中输入大段文字时,需要用到文本输入域。 <textarea rows="行数" cols="列数">在这里输入内容。。。</textarea> 1、<textarea>标签是成对出现的,以<textarea>开始,以</textarea>结束。 2、cols :多行输入域的列数。 3、rows :多行输入域的行数。 *单选框和复选框,两者的区别是单选框中的选项用户只能选择一项,而复选框中用户可以任意选择多项,甚至全选。 <input type="radio/checkbox" value="值" name="名称" checked="checked"/> 1、type: 当 type="radio" 时,控件为单选框。单选框时name属性必须一致。这样同一组的单选按钮才可以起到单选的作用。 当 type="checkbox" 时,控件为复选框。 2、value:提交数据到服务器的值。 *下拉列表框select: 语法:select通常要与option配合使用,option作为子列表项; <select> <option value=“提交值”selected=“selected”>…选项…</option> </select> <select> 标签中设置multiple="multiple"属性,就可以实现多选功能,在 widows 操作系统下,进行多选时按下Ctrl键同时进行单击(在 Mac下使用 Command +单击),可以选择多个选项。 *表单中有两种按钮可以使用,分别为:提交按钮、重置。 <input type="submit" value="提交"> type:只有当type值设置为submit时,按钮才有提交作用。 value:按钮上显示的文字。 <input type="reset" value="重置"> type:只有当type值设置为reset时,按钮才有重置作用。 *<label>标签不会向用户呈现任何效果,只是改善了用户体验,<label>标签内点击文本就会触发控件,注意for属性值必须和相关控件的id属性值一样<label for="控件id名称"> 语法: <label for="控件id名称"> 注意:标签的 for 属性中的值应当与相关控件的 id 属性值一定要相同。 例子: <form> <label for="male">男</label> <input type="radio" name="sex" id="male" /> <br /> <label for="female">女</label> <input type="radio" name="sex" id="female" /> <label for="email">输入你的邮箱地址</label> <input type="email" id="email" placeholder="Enter email"> <label>你对什么运动感兴趣:</label><br/> <label for="manpao">慢跑</label> <input type="checkbox"name="yundong"id="manpao"><br/> <label for="dengshan">登山</label> <input type="checkbox"name="yundong"id="dengshan"><br/> <label for="lanqiu">篮球</label> <input type="checkbox"name="yundong"id="lanqiu"> </form> </pre> <p><br /><br /> <p> <p class="sycode"> <p class="sycode"> <p class="sycode"> <p class="sycode"> <p class="sycode"> <p class="sycode"> <p class="sycode"> <p class="sycode"> </script>
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn