search
HomeWeb Front-endHTML Tutorialweb前端:html_html/css_WEB-ITnose

 一、理解表单的作用

1、web 应用程序不仅仅是给用户显示数据,还应该给用户提供一个可以输入数据的图形用户界面。表单的主要作用在于在网页上提供一个图形用户界面,已采集和提交用户输入的数据。

2、html表单元素和属性可以分为两种类型:

(1)定义表单整体结构,使浏览器知道如处理表单数据的元素;

 (2)  创建输入控件的元素。

3、最小的表单格式

标记最小格式(

4、http cet协议

(http://www.example.com/forums.cgi?id=1234&data=guest)

5、使用输入控件

1 inpu:该元素使用type属性定义不同的控件,包括文本和口令字段、复选框、单选框、提交和重置按钮、隐藏域和图像

2 select和option:二者组合使用,创建一个下拉列表

3 textarea:创建一个多行输入的文本框

<!DOCTYPE html><html><head lang="en">    <meta charset="UTF-8">    <title></title></head><body>  <table border="1">      <tr>          <th colspan="4" bgcolor="aqua" >机票信息查询</th>      </tr>      <tr>          <td bgcolor="#7fffd4">查询年份:</td>          <td style="width: 400px" bgcolor="#a9a9a9">              <select name="year" id="year">              <option value="">2014</option>              <option value="">2015</option>              <option value="">2016</option>                  <select>                      机票状态                      <select name="year" id="year" style="width: 100px">                          <option value=""></option>                      </select>          </td>          <td bgcolor="#7fffd4">模糊查询:</td>          <td style="width: 400px" bgcolor="#a9a9a9">              <input type="text" id="firstname">          </td>      </tr>      <tr>          <td bgcolor="#7fffd4">支付方式:</td>          <td bgcolor="#a9a9a9">              <select name="food" id="food" style="width: 150px"></select></td>          <td bgcolor="#7fffd4">航空公司:</td>          <td bgcolor="#a9a9a9">              <select name="food" id="food" style="width: 200px"></select></td>      </tr>      <tr>          <td bgcolor="#7fffd4">机票经手:</td>          <td bgcolor="#a9a9a9">              <select name="food" id="food" style="width: 250px"></select></td>          <td bgcolor="#7fffd4">未尽事宜:</td>          <td bgcolor="#a9a9a9">              <input type="checkbox" name="city" id="sh" style="width: 20px" />              <input type="text" id="firstname"/></td>      </tr>      <tr>          <td bgcolor="#7fffd4">证件状态:</td>          <td bgcolor="#a9a9a9">      寄票日期      </td>          <td bgcolor="#7fffd4">出票机构:</td>          <td bgcolor="#a9a9a9">              <select name="food" id="food" style="width: 200px"></select></td>      </tr>      <tr>          <td bgcolor="#7fffd4">订票日期:</td>          <td bgcolor="#a9a9a9">              <input type="text" id="good" style="width: 50px" />              <input type="text" style="width: 50px" /></td>          <td bgcolor="#7fffd4">出发日期:</td>          <td bgcolor="#a9a9a9">              <input type="text" id="good" style="width: 50px" />              <input type="text" style="width: 50px" /></td></td>      </tr>      <tr>          <td bgcolor="#7fffd4">出票日期:</td>          <td bgcolor="#a9a9a9">              <input type="text" id="good" style="width: 50px" />              <input type="text" style="width: 50px" /></td></td>          <td bgcolor="#7fffd4">应收结清:</td>          <td bgcolor="#a9a9a9">              <select name="good" id="good" style="width: 250px"></select></td>      </tr>      <tr>          <td bgcolor="#7fffd4">订票号码:</td>          <td bgcolor="#a9a9a9">              <input type="text" style="width: 200px"/></td>          <td bgcolor="#7fffd4">事故状态:</td>          <td bgcolor="#a9a9a9">              <select name="good"  style="width: 100px"></select></td>      </tr>      <tr>          <td bgcolor="#7fffd4">所在国家:</td>          <td bgcolor="#a9a9a9">              <select name="good"  style="width: 150px"></select></td>          <td bgcolor="#7fffd4">王朝号码:</td>          <td bgcolor="#a9a9a9">              <input type="text" style="width: 200px"/></td>      </tr>      <tr>          <td bgcolor="#7fffd4">机票号码:</td>          <td bgcolor="#a9a9a9">              <input type="text" style="width: 200px"/></td>          <td bgcolor="#7fffd4">价格代码:</td>          <td bgcolor="#a9a9a9">              <input type="text" style="width: 70px"/>              <button>每页行数:</button>              <input type="text" style="width: 50px"/></td>      </tr>      <tr>          <td bgcolor="#7fffd4">成都收款:</td>          <td bgcolor="#a9a9a9">              <input type="checkbox" name="city" id="sh" style="width: 20px"/>              已收  出票经手              <select name="food" style="width: 50px"></select>          </td>          <td bgcolor="#7fffd4">对账核实:</td>          <td bgcolor="#a9a9a9">              <select name="food" style="width: 70px" ></select></td>      </tr>      <tr>          <td bgcolor="#7fffd4">利润限定:</td>          <td bgcolor="#a9a9a9">              <input type="checkbox" style="width: 20px"/>仅显示利润小于10</td>          <td bgcolor="#7fffd4">指定列表:</td>          <td bgcolor="#a9a9a9">              <input type="radio" id="gender" value="male" >出票</input>              <input type="radio" id="gender" value="male" >收款</input>              <input type="radio" id="gender" value="male" >地址</input>              <input type="radio" id="gender" value="male" >联系</input>              <input type="radio" id="gender" value="male" >销售</input>              <input type="radio" id="gender" value="male" >收款2</input>          </td>      </tr>      <tr>          <th colspan="4" bgcolor="aqua">退款选项</th>      </tr>      <tr>          <td bgcolor="#7fffd4">退票清单:</td>          <td bgcolor="#a9a9a9">              <input type="checkbox" style="width: 20px"/>只显示退款信息          </td>          <td bgcolor="#7fffd4">入账未到:</td>          <td bgcolor="#a9a9a9"><input type="checkbox" style="width: 20px"/></td>      </tr>      <tr>          <td bgcolor="#7fffd4">出账未到:</td>          <td bgcolor="#a9a9a9"><input type="checkbox" style="width: 20px"/></td>          <td bgcolor="#7fffd4">退款经手:</td>          <td bgcolor="#a9a9a9"><select name="food" style="width: 200px" ></select>          </td>      </tr>      <tr>          <th colspan="4" bgcolor="#ff7f50"><button>确定</button> <button>退出</button></th>      </tr>  </table></body></html>
<h1 id="标题">标题</h1>
<p>段落</p>
<blockquote>引用</blockquote>
<ul>无序列表</ul>
<ol>有序列表</ol>
<dl>定义列表</dl>
<pre class="brush:php;toolbar:false">预定义标签</per>
<div>相当于区域块</div>
<span>针对一段文字</span><a>行内元素</a>
<strong>块级元素与内嵌元素</strong>
<strong>【块级元素:div,blockquote,列表元素(dl,ol,ul),fiekdset,from,h1-h6,hr,p,pre,table 等】</strong><strong>【内嵌元素:span,a,img,label,所有的表单输入元素,iframe,object 等】1 如果是内嵌元素,下一个元素就显示在该元素同一行上的后续位置。2 如果是块级元素,下一个元素就在浏览器下一行显示。3 元素中的文本按照元素的级别,浏览器使用不同大小的默认字体表示。</strong>

 

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 are boolean attributes in HTML? Give some examples.What are boolean attributes in HTML? Give some examples.Apr 25, 2025 am 12:01 AM

Boolean attributes are special attributes in HTML that are activated without a value. 1. The Boolean attribute controls the behavior of the element by whether it exists or not, such as disabled disable the input box. 2.Their working principle is to change element behavior according to the existence of attributes when the browser parses. 3. The basic usage is to directly add attributes, and the advanced usage can be dynamically controlled through JavaScript. 4. Common mistakes are mistakenly thinking that values ​​need to be set, and the correct writing method should be concise. 5. The best practice is to keep the code concise and use Boolean properties reasonably to optimize web page performance and user experience.

How can you validate your HTML code?How can you validate your HTML code?Apr 24, 2025 am 12:04 AM

HTML code can be cleaner with online validators, integrated tools and automated processes. 1) Use W3CMarkupValidationService to verify HTML code online. 2) Install and configure HTMLHint extension in VisualStudioCode for real-time verification. 3) Use HTMLTidy to automatically verify and clean HTML files in the construction process.

HTML vs. CSS and JavaScript: Comparing Web TechnologiesHTML vs. CSS and JavaScript: Comparing Web TechnologiesApr 23, 2025 am 12:05 AM

HTML, CSS and JavaScript are the core technologies for building modern web pages: 1. HTML defines the web page structure, 2. CSS is responsible for the appearance of the web page, 3. JavaScript provides web page dynamics and interactivity, and they work together to create a website with a good user experience.

HTML as a Markup Language: Its Function and PurposeHTML as a Markup Language: Its Function and PurposeApr 22, 2025 am 12:02 AM

The function of HTML is to define the structure and content of a web page, and its purpose is to provide a standardized way to display information. 1) HTML organizes various parts of the web page through tags and attributes, such as titles and paragraphs. 2) It supports the separation of content and performance and improves maintenance efficiency. 3) HTML is extensible, allowing custom tags to enhance SEO.

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.

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

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

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.

EditPlus Chinese cracked version

EditPlus Chinese cracked version

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