search
HomeWeb Front-endHTML TutorialFront-end notes for newbies--First introduction to html tags_html/css_WEB-ITnose

It has been more than a month since I came into contact with the front-end (what a great name). I have watched a lot of videos and blogs, and I have a certain perceptual understanding. However, I still need to summarize the knowledge I have learned in order to systematize it. Let’s start with Let’s start with the html tag. Regarding tags, the most talked about is conciseness and semantics. Simplicity means that the HTML tag is only responsible for correctly labeling the content on the page, while CSS is responsible for all the presentation of the content. Semanticization should not be a problem, because just like communication between people requires meaningful language, html documents are naturally meaningful as a language for people to communicate with browsers, but this does not make everyone follow (Similar to the emergence of Mandarin, local dialects are still popular in various places, because sometimes they can achieve the same purpose, so people always do it in the way they are most accustomed to). The succinct issues are summarized in CSS. Now let’s talk about semantic issues.

There are a total of 117 tags in w3school, of which 16 are not supported by html5, 29 new tags, and 72 tags inherited from the past.

Today, let’s roughly classify (according to my understanding of their semantics) these 72 “old” tags. On this basis, we will conduct semantic analysis step by step:

4 frame tags: ,,,

1 <!DOCTYPE>2 <html>3        <head>4            <title>标题</title>5        </head>6        <body>7               内容。。。8        </body>9 </html>

The

tag must appear within the tag. But it doesn't belong to the first part of what I said. 4 tags that can only (but are not required) or must appear within the tag: <title>,<meta>,<base>,<link class="sycode"> <pre class='brush:php;toolbar:false;'>1 <head>2 <title>标题</title>3 <meta http-equiv="content-type" content="text/html; charset=utf-8">4 <base href="#" />5 <link rel="stylesheet" type="text/css" href="#" />6 </head></pre> 22 text-related tags: <abbr>,<b>,<bdo>,<blockquote>,<cite>,<code>,,<del>,<em>,<h1>-<h6>,<i>,<ins>,<p>,</p> <pre class="brush:php;toolbar:false">,&lt;q&gt;,,&lt;smap&gt;&lt;sub&gt;,&lt;sup&gt;,&lt;span&gt;,&lt;strong&gt;,&lt;var&gt;, so many tags related to text also convey a message, that is, the text content is The most important part of a web page. 10 table-related tags: &lt;caption&gt;,&lt;/caption&gt; &lt;col&gt;,&lt;colgroup&gt;,&lt;table&gt;,&lt;th&gt;,&lt;/th&gt; &lt;tr&gt;,&lt;td&gt;,&lt;thead&gt;,,&lt;/thead&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tfoot&gt;. &lt;p class=&quot;sycode&quot;&gt; &lt;pre class='brush:php;toolbar:false;'&gt;&lt;table&gt; &lt;caption&gt;每月的存款&lt;/caption&gt; &lt;colgroup span=&quot;3&quot;&gt; &lt;col span=&quot;1&quot; style=&quot;background-color:red&quot;&gt; &lt;col span=&quot;3&quot; style=&quot;background-color:blue&quot;&gt; &lt;tr&gt; &lt;th&gt;月份&lt;/th&gt; &lt;th&gt;一月&lt;/th&gt; &lt;th&gt;二月&lt;/th&gt; &lt;th&gt;三月&lt;/th&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;存款&lt;/td&gt; &lt;td&gt;1000元&lt;/td&gt; &lt;td&gt;1000元&lt;/td&gt; &lt;td&gt;1000元&lt;/td&gt; &lt;/tr&gt;&lt;/table&gt;</pre> </p> <p class="sycode"> <pre class='brush:php;toolbar:false;'> 1 &lt;table&gt; 2 &lt;thead&gt; 3 &lt;tr&gt; 4 &lt;td&gt;THEAD 中的文本&lt;/td&gt; 5 &lt;/tr&gt; 6 &lt;/thead&gt; 7 &lt;tfoot&gt; 8 &lt;tr&gt; 9 &lt;td&gt;TFOOT 中的文本&lt;/td&gt;10 &lt;/tr&gt;11 &lt;/tfoot&gt;12 &lt;tbody&gt;13 &lt;tr&gt;14 &lt;td&gt;TBODY 中的文本&lt;/td&gt; 15 &lt;/tr&gt;16 &lt;/tbody&gt;17 &lt;/table&gt;</pre> </p> <p> </p> 10 form-related tags: <fieldset>,<legend>,<form>,<input>,<select>,<option>,</option> <optgroup>,<menu>,<textarea>. <p class="sycode"> </p> <p class="sycode"> <pre class='brush:php;toolbar:false;'> 1 &lt;form action=&quot;DoFormAction.htm&quot;&gt; 2 &lt;fieldset style=&quot;width=800px&quot;&gt; &lt;!--套住注册表格的边框--&gt; 3 &lt;legend&gt;请输入如下的信息然后进行注册&lt;/legend&gt; 4 &lt;table cellspacing=&quot;0px&quot; cellpadding=&quot;6px&quot; border=&quot;1px&quot; bordercolor=&quot;black&quot; align=&quot;center&quot; width=&quot;600px&quot;&gt; 5 &lt;tr&gt; 6 &lt;td align=&quot;right&quot;&gt;用户名:&lt;/td&gt; &lt;!--文本框--&gt; 7 &lt;td&gt;&lt;input type=&quot;text&quot; size=&quot;20&quot; style=&quot;width:150px&quot; /&gt;&lt;/td&gt; 8 &lt;/tr&gt; 9 &lt;tr&gt; 10 &lt;td align=&quot;right&quot;&gt;密码:&lt;/td&gt; &lt;!--密码框--&gt; 11 &lt;td&gt;&lt;input type=&quot;password&quot; size=&quot;20&quot; style=&quot;width:150px&quot; /&gt;&lt;/td&gt; 12 &lt;/tr&gt; 13 &lt;tr&gt; 14 &lt;td align=&quot;right&quot;&gt;确认密码:&lt;/td&gt; 15 &lt;td&gt;&lt;input type=&quot;password&quot; size=&quot;20&quot; style=&quot;width:150px&quot; /&gt;&lt;/td&gt; 16 &lt;/tr&gt; 17 &lt;tr&gt; 18 &lt;td align=&quot;right&quot;&gt;性别:&lt;/td&gt; &lt;!--单选框--&gt; 19 &lt;td&gt; 20 &lt;input type=&quot;radio&quot; checked=&quot;checked&quot; name=&quot;sex1&quot; value=&quot;男&quot; /&gt;男 21 &lt;input type=&quot;radio&quot; name=&quot;sex1&quot; value=&quot;女&quot; /&gt;女 22 &lt;/td&gt; 23 &lt;/tr&gt; 24 &lt;tr&gt; 25 &lt;td align=&quot;right&quot;&gt;性别(可以点文字选择):&lt;/td&gt; 26 &lt;td&gt; 27 &lt;fieldset style=&quot;width:150px&quot;&gt; &lt;!--表单外框,也可以通过css设置宽度--&gt; 28 &lt;legend&gt;请选择性别&lt;/legend&gt; 29 &lt;input type=&quot;radio&quot; checked=&quot;checked&quot; name=&quot;sex2&quot; value=&quot;男&quot; id=&quot;man&quot; /&gt; 30 &lt;label for=&quot;man&quot;&gt;男&lt;/label&gt; 31 &lt;input type=&quot;radio&quot; name=&quot;sex2&quot; value=&quot;女&quot; id=&quot;woman&quot; /&gt; 32 &lt;label for=&quot;woman&quot;&gt;女&lt;/label&gt; 33 &lt;/fieldset&gt; 34 &lt;/td&gt; 35 &lt;/tr&gt; 36 &lt;tr&gt; 37 &lt;td align=&quot;right&quot;&gt;城市:&lt;/td&gt; &lt;!--下拉框--&gt; 38 &lt;td&gt; 39 &lt;select name=&quot;city&quot;&gt; 40 &lt;option value=&quot;北京&quot;&gt;北京&lt;/option&gt; 41 &lt;option value=&quot;深圳&quot;&gt;深圳&lt;/option&gt; 42 &lt;option value=&quot;上海&quot;&gt;上海&lt;/option&gt; 43 &lt;option value=&quot;南昌&quot; selected=&quot;selected&quot;&gt;南昌&lt;/option&gt; &lt;!--默认选择南昌--&gt; 44 &lt;/select&gt; 45 &lt;/td&gt; 46 &lt;/tr&gt; 47 &lt;tr&gt; 48 &lt;td align=&quot;right&quot;&gt;城市所在区域:&lt;/td&gt; 49 &lt;td&gt; 50 &lt;select name=&quot;area&quot;&gt; 51 &lt;optgroup label=&quot;北京&quot;&gt; &lt;!--下拉框分组显示--&gt; 52 &lt;option value=&quot;朝阳区&quot;&gt;朝阳区&lt;/option&gt; 53 &lt;option value=&quot;海淀区&quot;&gt;海淀区&lt;/option&gt; 54 &lt;option value=&quot;其他区&quot;&gt;其他区&lt;/option&gt; 55 &lt;/optgroup&gt; 56 &lt;optgroup label=&quot;南昌&quot;&gt; 57 &lt;option value=&quot;东湖区&quot;&gt;东湖区&lt;/option&gt; 58 &lt;option value=&quot;西湖区&quot;&gt;西湖区&lt;/option&gt; 59 &lt;option value=&quot;青山湖区&quot;&gt;青山湖区&lt;/option&gt; 60 &lt;/optgroup&gt; 61 &lt;/select&gt; 62 &lt;/td&gt; 63 &lt;/tr&gt; 64 &lt;tr&gt; 65 &lt;td align=&quot;right&quot;&gt;交友目标:&lt;/td&gt; 66 &lt;td&gt; 67 &lt;select name=&quot;target&quot; size=&quot;3&quot; multiple=&quot;multiple&quot;&gt; &lt;!--列表框--&gt; 68 &lt;option value=&quot;同行&quot; selected=&quot;selected&quot;&gt;同行&lt;/option&gt; 69 &lt;option value=&quot;普通朋友&quot;&gt;普通朋友&lt;/option&gt; 70 &lt;option value=&quot;爱人&quot;&gt;爱人&lt;/option&gt; 71 &lt;/select&gt; 72 &lt;/td&gt; 73 &lt;/tr&gt; 74 &lt;tr&gt; 75 &lt;td align=&quot;right&quot;&gt;爱好:&lt;/td&gt; 76 &lt;td&gt; 77 &lt;!--复选框,注意name属性设置一样,分组--&gt; 78 &lt;input type=&quot;checkbox&quot; name=&quot;love&quot; value=&quot;足球&quot; /&gt;足球 79 &lt;input type=&quot;checkbox&quot; name=&quot;love&quot; value=&quot;蓝球&quot; /&gt;蓝球 80 &lt;input type=&quot;checkbox&quot; name=&quot;love&quot; value=&quot;乒乓球&quot; /&gt;乒乓球 81 &lt;/td&gt; 82 &lt;/tr&gt; 83 &lt;tr&gt; 84 &lt;td align=&quot;right&quot;&gt;照片上传:&lt;/td&gt; 85 &lt;td&gt; 86 &lt;!--文件选择框--&gt; 87 &lt;input type=&quot;file&quot; name=&quot;myPic&quot; /&gt; 88 &lt;/td&gt; 89 &lt;/tr&gt; 90 &lt;tr&gt; 91 &lt;td align=&quot;right&quot;&gt;自我介绍:&lt;/td&gt; 92 &lt;td&gt; 93 &lt;!--多行文本框--&gt; 94 &lt;textarea rows=&quot;5&quot; cols=&quot;50&quot;&gt; 95 &lt;/textarea&gt; 96 &lt;/td&gt; 97 &lt;/tr&gt; 98 &lt;tr&gt; 99 &lt;td align=&quot;center&quot; colspan=&quot;2&quot;&gt;100 &lt;input type=&quot;submit&quot; value=&quot;确定&quot; /&gt;101 &lt;input type=&quot;reset&quot; value=&quot;清空&quot; /&gt; 102 &lt;input type=&quot;image&quot; src=&quot;../images/btnreg.png&quot; onclick=&quot;alert('hello')&quot; /&gt; &lt;!--演示图片按钮(会提交数据,类似submit)103 --&gt;104 &lt;/td&gt;105 &lt;/tr&gt;106 &lt;/table&gt;107 &lt;/fieldset&gt;108 &lt;/form&gt;</pre> </p> View Code <p>This form is laid out by tables, which was a popular method a long time ago and is rarely used now. As far as I can see, they are all laid out using definition lists (</p> <dl> <dt></dt> <dd>) and div tags. The above code is found from the Internet, and the tag application is very complete, so Use it here. 6 list-related tags: <ol>,</ol> <ul>,<li>,<dl>,<dt>,</dt> <dd>. <p class="sycode"> <pre class='brush:php;toolbar:false;'> 1 &lt;!--有序列表--&gt; 2 &lt;ol&gt; 3 &lt;li&gt;春&lt;/li&gt; 4 &lt;li&gt;夏&lt;/li&gt; 5 &lt;li&gt;秋&lt;/li&gt; 6 &lt;li&gt;冬&lt;/li&gt; 7 &lt;/ol&gt; 8 &lt;!--无序列表--&gt; 9 &lt;ul&gt;10 &lt;li&gt;春&lt;/li&gt;11 &lt;li&gt;夏&lt;/li&gt;12 &lt;li&gt;秋&lt;/li&gt;13 &lt;li&gt;冬&lt;/li&gt;14 &lt;/ul&gt;15 &lt;!--定义列表--&gt;16 &lt;dl&gt;17 &lt;dt&gt;Coffee&lt;/dt&gt;18 &lt;dd&gt;Black hot drink&lt;/dd&gt;19 &lt;dt&gt;Milk&lt;/dt&gt;20 &lt;dd&gt;White cold drink&lt;/dd&gt;21 &lt;/dl&gt;</pre> </p> <p> </p> 3 image-related tags: <img src="/static/imghwm/default1.png" data-src="planets.gif" class="lazy" alt="Front-end notes for newbies--First introduction to html tags_html/css_WEB-ITnose" >, <map>, <area>. <p class="sycode"> <pre class='brush:php;toolbar:false;'>&lt;img src=&quot;/static/imghwm/default1.png&quot; data-src=&quot;planets.gif&quot; class=&quot;lazy&quot; alt=&quot;Planets&quot; usemap =&quot;#planetmap&quot; /&gt; &lt;map id=&quot;planetmap&quot;&gt; &lt;area shape =&quot;rect&quot; coords =&quot;0,0,110,260&quot; href =&quot;sun.htm&quot; alt=&quot;Sun&quot; /&gt; &lt;area shape =&quot;circle&quot; coords =&quot;129,161,10&quot; href =&quot;mercur.htm&quot; alt=&quot;Mercury&quot; /&gt; &lt;area shape =&quot;circle&quot; coords =&quot;180,139,14&quot; href =&quot;venus.htm&quot; alt=&quot;Venus&quot; /&gt; &lt;/map&gt;</pre> </p> <p> </p> 5 introduction tags: <style>,<script>,<noscript>,<object><param>. <style>--Introduce a style sheet to the html document, <script> and <noscript> introduce scripts to the html document, <object> and <param> define the introduction of multimedia objects and set parameters for them. <p>2 container tags: <div>, <iframe>. The former divides the content to be displayed on the entire page into multiple "blocks" so that the CSS style sheet can style each part. The latter can display multiple pages on the screen. The most common applications are in the mailbox page and the background management page. The advantage is that when the content of a block on the screen is changed, other parts do not change. <p> 10. There are 6 separate tags left: <!----> for comments, <br /> for line breaks, <hr> dividing line, <a> Define hyperlinks, <button> define buttons, <address> address labels. <p> The summary of the "old" tags is the above. In the future, some important and commonly used tags will be summarized. <p> </style></map> </dd> </dl> </li> </ul> </dd> </dl></textarea> </menu> </optgroup></select> </form> </legend> </fieldset> </tfoot> </table> </colgroup></var></strong></span></sup></sub></smap></q></pre></ins></i> </h6> </h1></em></del></code></cite> </blockquote></bdo></b></abbr>
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 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 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 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

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 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.

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)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.