search
HomeWeb Front-endHTML TutorialHTML常见标签学习与笔记总结_html/css_WEB-ITnose

HTML其实就是把页面的数据封装并加上标签

表头

浏览器标题栏显示的内容 <p><base> 有href和target属性,href指定网页中所有超链接的基本目录,target指定打开超链接的方式,如_blank为在新窗口中打开</p> <p><meta> name网页的描述信息,可以设置网页搜索的关键字keywords。http-equiv可以设置自动刷新</p> <p class="sycode"> <pre class='brush:php;toolbar:false;'>如:<meta http-equiv=”refresh” content=”3”;url=http://sina.com.cn” /> 设置3秒自动刷新</pre> </p> <p><link> rel属性:描述目标文档与当前文档的关系,type:文档类型,media:目标文档在哪种设备上起作用,如显示器或打印机<br></p> <h3 id="表单">表单</h3> <form> <p>用来与服务端进行交互,意味着只要不和服务端交互就不需要form标签<br></p> <h4 class="mt-10"> <input>的type属性</h4> <ol> <li><p>text:文本框</p></li> <li><p>password:密码框</p></li> <li><p>radio:单选框,需要指定同一组(即name值相同)</p></li> <li><p>checkbox:复选框</p></li> <li><p>file:文件选择</p></li> <li><p>hidden:隐藏组件。不会在页面上显示,但其定义的name和value可以提交给服务器</p></li> <li><p>botton:按钮组件。默认没有效果,可以通过注册事件并加入自定义效果</p></li> <li><p>submie:提交按钮</p></li> <li><p>reset:重置按钮</p></li> <li><p>image:图像组件。可以通过image的src属性连接一个按钮图片代替submit<br><br></p></li> </ol> <h4 class="mt-10">下垃菜单<select></select> </h4> <p>每一个下拉菜单项都由option进行封装<br></p> <p class="sycode"> <pre class='brush:php;toolbar:false;'><select> <option></option> <option></option></select></pre> </p> <h4 class="mt-10">文本区域<textarea></textarea> </h4> <h4 id="表格">表格</h4> <table> <p class="sycode"> <pre class='brush:php;toolbar:false;'><table> <tbody> <tr> <td></td> <td></td> </tr> </tbody></table></pre> </p> <h4 class="mt-10">超链接<a></a> </h4> <p class="sycode"> <pre class='brush:php;toolbar:false;'><a href="http://www.sina.com.cn" target="_blank"> 新浪网站<a></pre> </p> <p>http:为解析程序,即使用http协议解析链接。设置target属性,在新窗口打开链接。</p> <p class="sycode"> <pre class='brush:php;toolbar:false;'><a href="mailto:abc@163.com?subject=haha&cc=qq@163.com" > 联系我们 </a> </pre> </p> <p>当点击超链接时,就会出现邮件相关联的解析程序,本机默认的是outlook.</p> <p>链接讯雷的解析程序可以自己百度,这里就不说了。</p> <h4 id="form标签常见属性">form标签常见属性</h4> <p>action<br></p> <p>method(get和post)<br></p> get和post区别: <p>get会将提交的数据显示在浏览器的地址栏上,post则不会</p> <p>get提交的数据的体积受地址栏的限制(即不能超过地址栏的长度),post没有这种限制</p> <p>get对于敏感信息不安全(如用户名和密码),post安全</p> <p>get会将提交的信息封装在请求行,即http消息头之前,post会将提交信息封装在数据何体中,即http消息头之后的空行后</p> <p>对于服务器来说:<br></p> <p>表单form提交数据尽量用post,因为涉及到编码问题。tomcat服务端默认的解码是ISO8859-1<br></p> <p>对于post提交的中文,在服务端可以直接使用setCharacterEncoding("gbk")就可以解决。而对于get提交的中文,在服务端只能通过ISO8859-1将数据编码一次,再通过指定的码表(如GBK)解码。</p> <h4 id="其他">其他</h4> <ol> <li> <p><label>标签:当点击用户名这栏时(不是点击文本框)或按Ctrl+u快捷键,焦点也会到了文本框内</label></p> <p class="sycode"> <pre class='brush:php;toolbar:false;'><label acdessky=”u” for=”userid”><tr><td> 用户名(U):</td><td> <input type=”text” name=”user” id=”userid” /></td></tr></label></pre> </p> <br> </li> <li>书写链接地址时,必须避免重定向,例如:href="http://sina.com/",即须在URL地址后面加上"/"</li> <li>在页面中尽量避免使用style属性,即style="..."</li> <li> <p>必须为含有描述性的表单元素(input,textarea)添加label。</p> <p class="sycode"> <pre class='brush:php;toolbar:false;'><p><label for=”name”>姓名:</label><input type=”text” id=”name” /></p></pre> </p> <br> </li> <li>能以背景形式呈现的图片,尽量写入CSS样式中</li> <li>重要图片必须加上alt属性</li> <li>class和id的使用:id是唯一的并是父级的,class是可以重复的并是子级的,所以id仅使用在大的模块上,class可用在重复使用率高及子级中。id原则上都是由分发框架文件时命名的,为javaScript预留钩子的除外。</li> <li><p>为javaScript预留钩子的命名,请以js_起始,比如: js _show、js _hide。</p></li> </ol> <p>over!</p> <p class="sycode"></p> <p class="sycode"></p> <p class="sycode"> </p> <p class="sycode"></p> <p class="sycode"></p> <p class="sycode"> </p> <p class="sycode"></p> <p class="sycode"></p> </table> </form>
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
The Future of HTML, CSS, and JavaScript: Web Development TrendsThe Future of HTML, CSS, and JavaScript: Web Development TrendsApr 19, 2025 am 12:02 AM

The future trends of HTML are semantics and web components, the future trends of CSS are CSS-in-JS and CSSHoudini, and the future trends of JavaScript are WebAssembly and Serverless. 1. HTML semantics improve accessibility and SEO effects, and Web components improve development efficiency, but attention should be paid to browser compatibility. 2. CSS-in-JS enhances style management flexibility but may increase file size. CSSHoudini allows direct operation of CSS rendering. 3.WebAssembly optimizes browser application performance but has a steep learning curve, and Serverless simplifies development but requires optimization of cold start problems.

HTML: The Structure, CSS: The Style, JavaScript: The BehaviorHTML: The Structure, CSS: The Style, JavaScript: The BehaviorApr 18, 2025 am 12:09 AM

The roles of HTML, CSS and JavaScript in web development are: 1. HTML defines the web page structure, 2. CSS controls the web page style, and 3. JavaScript adds dynamic behavior. Together, they build the framework, aesthetics and interactivity of modern websites.

The Future of HTML: Evolution and Trends in Web DesignThe Future of HTML: Evolution and Trends in Web DesignApr 17, 2025 am 12:12 AM

The future of HTML is full of infinite possibilities. 1) New features and standards will include more semantic tags and the popularity of WebComponents. 2) The web design trend will continue to develop towards responsive and accessible design. 3) Performance optimization will improve the user experience through responsive image loading and lazy loading technologies.

HTML vs. CSS vs. JavaScript: A Comparative OverviewHTML vs. CSS vs. JavaScript: A Comparative OverviewApr 16, 2025 am 12:04 AM

The roles of HTML, CSS and JavaScript in web development are: HTML is responsible for content structure, CSS is responsible for style, and JavaScript is responsible for dynamic behavior. 1. HTML defines the web page structure and content through tags to ensure semantics. 2. CSS controls the web page style through selectors and attributes to make it beautiful and easy to read. 3. JavaScript controls web page behavior through scripts to achieve dynamic and interactive functions.

HTML: Is It a Programming Language or Something Else?HTML: Is It a Programming Language or Something Else?Apr 15, 2025 am 12:13 AM

HTMLisnotaprogramminglanguage;itisamarkuplanguage.1)HTMLstructuresandformatswebcontentusingtags.2)ItworkswithCSSforstylingandJavaScriptforinteractivity,enhancingwebdevelopment.

HTML: Building the Structure of Web PagesHTML: Building the Structure of Web PagesApr 14, 2025 am 12:14 AM

HTML is the cornerstone of building web page structure. 1. HTML defines the content structure and semantics, and uses, etc. tags. 2. Provide semantic markers, such as, etc., to improve SEO effect. 3. To realize user interaction through tags, pay attention to form verification. 4. Use advanced elements such as, combined with JavaScript to achieve dynamic effects. 5. Common errors include unclosed labels and unquoted attribute values, and verification tools are required. 6. Optimization strategies include reducing HTTP requests, compressing HTML, using semantic tags, etc.

From Text to Websites: The Power of HTMLFrom Text to Websites: The Power of HTMLApr 13, 2025 am 12:07 AM

HTML is a language used to build web pages, defining web page structure and content through tags and attributes. 1) HTML organizes document structure through tags, such as,. 2) The browser parses HTML to build the DOM and renders the web page. 3) New features of HTML5, such as, enhance multimedia functions. 4) Common errors include unclosed labels and unquoted attribute values. 5) Optimization suggestions include using semantic tags and reducing file size.

Understanding HTML, CSS, and JavaScript: A Beginner's GuideUnderstanding HTML, CSS, and JavaScript: A Beginner's GuideApr 12, 2025 am 12:02 AM

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)