search
HomeWeb Front-endHTML TutorialTags commonly used in Html_html/css_WEB-ITnose

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 &lt;p&gt;, &lt;address&gt;, etc. &lt;p&gt; *&lt;ul&gt; &lt;pre class='brush:php;toolbar:false;'&gt; &lt;li&gt;信息&lt;/li&gt; &lt;li&gt;信息&lt;/li&gt; ...... &lt;/ul&gt;  ul-li是没有前后顺序的信息列表标签。ul-li在网页中显示的默认样式一般为:每项li前都自带一个圆点。 *&lt;ol&gt;</pre> <pre class='brush:php;toolbar:false;'> &lt;li&gt;信息&lt;/li&gt; &lt;li&gt;信息&lt;/li&gt; ...... &lt;/ol&gt; &lt;ol&gt;&lt;li&gt;&lt;/li&gt;&lt;/ol&gt;,有序标签,相比&lt;ul&gt;,菜单格式添加数字显示.   *&lt;div&gt;…&lt;/div&gt;,在网页制作过程过中,可以把一些独立的逻辑部分划分出来,放在一个&lt;div&gt;标签中,这个&lt;div&gt;标签的作用就相当于一个容器。用id属性来为&lt;div&gt;提供唯一的名称,这个就像我们每个人都有一个身份证号,这个身份证号是唯一标识我们的身份的,也是必须唯一的。  *创建表格的四个元素:  table、tbody、tr、th、td  1、&lt;table&gt;…&lt;/table&gt;:整个表格以&lt;table&gt;标记开始、&lt;/table&gt;标记结束。  2、&lt;tbody&gt;…&lt;/tbody&gt;:当表格内容非常多时,表格会下载一点显示一点,但如果加上&lt;tbody&gt;标签后,这个表格就要等表格内容全部下载完才会显示。如右侧代码编辑器中的代码。  3、&lt;tr&gt;…&lt;/tr&gt;:表格的一行,所以有几对tr 表格就有几行。  4、&lt;td&gt;…&lt;/td&gt;:表格的一个单元格,一行中包含几对&lt;td&gt;...&lt;/td&gt;,说明一行中就有几列。  5、&lt;th&gt;…&lt;/th&gt;:表格的头部的一个单元格,表格表头。  6、表格中列的个数,取决于一行中数据单元格的个数。    *&lt;table summary=&quot;摘要&quot;&gt;  &lt;caption&gt;表格标题&lt;/caption&gt;:位置落于整个表格的正上方,居中  &lt;/table&gt;    *&lt;a&gt;超链接标签,&lt;a href=&quot;目标网址&quot; title=&quot;鼠标滑过显示的文本&quot;&gt;链接显示的文本&lt;/a&gt;。  *&lt;a&gt;标签使用mailto可以连接邮箱地址,方便向管理者发送邮件。参数,mailto:邮箱地址;cc=抄送地址;bcc=密送地址;subject=添加邮件主题;body=添加邮件内容【多个收件人之间用“;”分隔;mailto多个参数后面第一参数用“?”分隔,后面的参数每一个都以“&amp;”分隔。】例:&lt;a href=&quot;mailto:yy@imooc.com?subject=观了不起的盖茨比有感&amp;body=你好,对此评论有些想法。&quot;&gt;对此影评有何感想,发送邮件给我&lt;/a&gt;。  *&lt;img src=&quot;/static/imghwm/default1.png&quot; data-src=&quot;图片地址&quot; class=&quot;lazy&quot; alt=&quot;下载失败时的替换文本&quot; title = &quot;提示文本&quot;&gt;  1、src:标识图像的位置;  2、alt:指定图像的描述性文本,当图像不可见时(下载不成功时),可看到该属性指定的文本;  3、title:提供在图像可见时对图像的描述(鼠标滑过图片时显示的文本);  4、图像可以是GIF,PNG,JPEG格式的图像文件;  *使用表单标签,与用户交互&lt;form&gt; ...&lt;/form&gt;  语法:&lt;form method=&quot;传送方式&quot; action=&quot;服务器文件&quot;&gt;  1.&lt;form&gt; :&lt;form&gt;标签是成对出现的,以&lt;form&gt;开始,以&lt;/form&gt;结束。  2.action :浏览者输入的数据被传送到的地方,比如一个PHP页面(save.php)。  3.method : 数据传送的方式(get/post)。  注意:  1、所有表单控件(文本框、文本域、按钮、单选框、复选框等)都必须放在&lt;form&gt;&lt;/form&gt;标签之间(否则用户输入的信息可提交不到服务器上哦!)。  *&lt;form&gt;  &lt;input type=&quot;text/password&quot; name=&quot;名称&quot; value=&quot;文本&quot; /&gt; &quot;input&quot;是单标签,所以后面有个/  &lt;/form&gt;  1、type:  当type=&quot;text&quot;时,输入框为文本输入框;  当type=&quot;password&quot;时, 输入框为密码输入框。  2、name:为文本框命名,以备后台程序ASP 、PHP使用。  3、value:为文本输入框设置默认值。(一般起到提示作用)。  *当用户需要在表单中输入大段文字时,需要用到文本输入域。  &lt;textarea rows=&quot;行数&quot; cols=&quot;列数&quot;&gt;在这里输入内容。。。&lt;/textarea&gt;  1、&lt;textarea&gt;标签是成对出现的,以&lt;textarea&gt;开始,以&lt;/textarea&gt;结束。  2、cols :多行输入域的列数。  3、rows :多行输入域的行数。  *单选框和复选框,两者的区别是单选框中的选项用户只能选择一项,而复选框中用户可以任意选择多项,甚至全选。  &lt;input type=&quot;radio/checkbox&quot; value=&quot;值&quot; name=&quot;名称&quot; checked=&quot;checked&quot;/&gt;  1、type:  当 type=&quot;radio&quot; 时,控件为单选框。单选框时name属性必须一致。这样同一组的单选按钮才可以起到单选的作用。  当 type=&quot;checkbox&quot; 时,控件为复选框。  2、value:提交数据到服务器的值。  *下拉列表框select:  语法:select通常要与option配合使用,option作为子列表项;  &lt;select&gt;  &lt;option value=“提交值”selected=“selected”&gt;…选项…&lt;/option&gt;  &lt;/select&gt;  &lt;select&gt;  标签中设置multiple=&quot;multiple&quot;属性,就可以实现多选功能,在 widows 操作系统下,进行多选时按下Ctrl键同时进行单击(在 Mac下使用 Command +单击),可以选择多个选项。   *表单中有两种按钮可以使用,分别为:提交按钮、重置。  &lt;input type=&quot;submit&quot; value=&quot;提交&quot;&gt;  type:只有当type值设置为submit时,按钮才有提交作用。  value:按钮上显示的文字。  &lt;input type=&quot;reset&quot; value=&quot;重置&quot;&gt;  type:只有当type值设置为reset时,按钮才有重置作用。  *&lt;label&gt;标签不会向用户呈现任何效果,只是改善了用户体验,&lt;label&gt;标签内点击文本就会触发控件,注意for属性值必须和相关控件的id属性值一样&lt;label for=&quot;控件id名称&quot;&gt;  语法:  &lt;label for=&quot;控件id名称&quot;&gt;  注意:标签的 for 属性中的值应当与相关控件的 id 属性值一定要相同。  例子:  &lt;form&gt;  &lt;label for=&quot;male&quot;&gt;男&lt;/label&gt;  &lt;input type=&quot;radio&quot; name=&quot;sex&quot; id=&quot;male&quot; /&gt;  &lt;br /&gt;  &lt;label for=&quot;female&quot;&gt;女&lt;/label&gt;  &lt;input type=&quot;radio&quot; name=&quot;sex&quot; id=&quot;female&quot; /&gt;  &lt;label for=&quot;email&quot;&gt;输入你的邮箱地址&lt;/label&gt;  &lt;input type=&quot;email&quot; id=&quot;email&quot; placeholder=&quot;Enter email&quot;&gt;  &lt;label&gt;你对什么运动感兴趣:&lt;/label&gt;&lt;br/&gt;  &lt;label for=&quot;manpao&quot;&gt;慢跑&lt;/label&gt;  &lt;input type=&quot;checkbox&quot;name=&quot;yundong&quot;id=&quot;manpao&quot;&gt;&lt;br/&gt;  &lt;label for=&quot;dengshan&quot;&gt;登山&lt;/label&gt;  &lt;input type=&quot;checkbox&quot;name=&quot;yundong&quot;id=&quot;dengshan&quot;&gt;&lt;br/&gt;  &lt;label for=&quot;lanqiu&quot;&gt;篮球&lt;/label&gt;  &lt;input type=&quot;checkbox&quot;name=&quot;yundong&quot;id=&quot;lanqiu&quot;&gt;  &lt;/form&gt;  </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
What is the purpose of the <datalist> element?What is the purpose of the <datalist> element?Mar 21, 2025 pm 12:33 PM

The article discusses the HTML <datalist> element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

What is the purpose of the <progress> element?What is the purpose of the <progress> element?Mar 21, 2025 pm 12:34 PM

The article discusses the HTML <progress> element, its purpose, styling, and differences from the <meter> element. The main focus is on using <progress> for task completion and <meter> for stati

What is the purpose of the <meter> element?What is the purpose of the <meter> element?Mar 21, 2025 pm 12:35 PM

The article discusses the HTML <meter> element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates <meter> from <progress> and ex

What is the purpose of the <iframe> tag? What are the security considerations when using it?What is the purpose of the <iframe> tag? What are the security considerations when using it?Mar 20, 2025 pm 06:05 PM

The article discusses the <iframe> tag's purpose in embedding external content into webpages, its common uses, security risks, and alternatives like object tags and APIs.

How do I use HTML5 form validation attributes to validate user input?How do I use HTML5 form validation attributes to validate user input?Mar 17, 2025 pm 12:27 PM

The article discusses using HTML5 form validation attributes like required, pattern, min, max, and length limits to validate user input directly in the browser.

What is the viewport meta tag? Why is it important for responsive design?What is the viewport meta tag? Why is it important for responsive design?Mar 20, 2025 pm 05:56 PM

The article discusses the viewport meta tag, essential for responsive web design on mobile devices. It explains how proper use ensures optimal content scaling and user interaction, while misuse can lead to design and accessibility issues.

What are the best practices for cross-browser compatibility in HTML5?What are the best practices for cross-browser compatibility in HTML5?Mar 17, 2025 pm 12:20 PM

Article discusses best practices for ensuring HTML5 cross-browser compatibility, focusing on feature detection, progressive enhancement, and testing methods.

How do I use the HTML5 <time> element to represent dates and times semantically?How do I use the HTML5 <time> element to represent dates and times semantically?Mar 12, 2025 pm 04:05 PM

This article explains the HTML5 <time> element for semantic date/time representation. It emphasizes the importance of the datetime attribute for machine readability (ISO 8601 format) alongside human-readable text, boosting accessibilit

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),