Home  >  Article  >  Java  >  What HTML and CSS knowledge points are involved in Java Web?

What HTML and CSS knowledge points are involved in Java Web?

王林
王林forward
2023-04-23 14:49:141495browse

1.HTML

1.1 Form tag: form

The form tag creates a form on the html page. The form tag does not display anything on the browser. If the data needs to be submitted to the server, the tag responsible for collecting the data must be placed in the form tag body content.

Action attribute: request path, determine the address (path) where the form is submitted to the server

Method attribute: request method. Commonly used values: get, post

  get:Default value

The submitted data is appended to the request path. For example: /1.html?username=alex&password=1234, data format k/v, append using ? connection, and then use & connection for each pair of data

Because the request path length is limited, all get requests submit limited data.

Post:

The submitted data is no longer appended to the request path (neither displayed on the address bar)

The size of the submitted data is not displayed

<body>
      <!-- 表单 -->
      <form action="" method="">
            <!-- 此处的内容可能被提交到服务器 -->
      </form>
      <!-- 此处的内容在<form>标签外部,此处数据不能提交到表单 -->
</body>

1.2 Input field label: input

The tag is used to obtain user input information. The type attribute value is different and the collection method is different. Most commonly used tags.

​rype attribute

text: text box, a single-line input field in which the user can enter text. Default width is 20 characters

Password: Password box, password field. Characters in this field appear in black circles.

radio: radio button, representing one of a set of mutually exclusive option buttons. When a button is selected, the previously selected button becomes unselected.

Submit: Submit button. The submit button sends the form data to the server. Generally, the name attribute is not written, otherwise the word "submit" will be submitted to the server.

Because different projects require different fields, I have not written out all the form elements. The use of the following tags also needs to be mastered by everyone.

   checkbox:checkbox

Filee: file upload component, provides "browse", press to select the file to be uploaded.

Hidden: Hidden field, the data will be sent to the server, but the browser will not display it.

Reset: Reset button. Restore the form to default values.

Image: Image submission button, set the image for the button through src.

Button: Common button, often used in combination with JavaScript.

name: element name. If you need to submit form data to the server, you must provide the name attribute value. The server obtains the submitted data through the attribute value.

Value: Set the default value of the input tag. The submit and reset buttons submit data

size: size

Checked attribute: The radio button or check box is selected.

readonly: Whether it is read-only

disabled: whether it is available

maxlength: The maximum length allowed for input

1.3 Drop-down list label: select