Use css to beautify html Form Controls (Form beautification) _ HTML/Xhtml _ webpage Creation

Source: Internet
Author: User
This article describes how to beautify html form controls using css (Form beautification). For more information, see section 1. Basic syntax structure of html submit and bottom buttons.

1. html submit button

Set type = "submit" in the input label to set this form control as a button.

Code of the submit button:


The Code is as follows:



Submit button Effect

Html submit button Effect

2. html bottom button

You can also set type = "bottom" in the input label to set this form control as a button.

Bottom button code:


The Code is as follows:



Bottom button:

Html botton button Effect

Ii. Differences between html submit and bottom buttons

Type = button is simply a button Function

Type = submit is the sending form

However, people engaged in web ui should note that using submit to improve the ease of use of pages:

After submit is used, the page supports the enter key operation. Many WEB software designers may not notice that the submit is unified.

After a button is used, the page usually does not support the enter key. Therefore, the enter key must be supported and a submit must be set. The default enter key is used to operate the first submit on the page.


The Code is as follows:



After onClick is executed, go to action. OnClick is not required for automatic submission. So onclick can be avoided here.


The Code is as follows:



After onClick is executed, the jump file is controlled in the js file. OnClick is required for submission.

For example:

1. onclick = "form1.action = 'a. jsp '; form1.submit ();" This enables the submit function.

2. button code


The Code is as follows:



Button

3. Button HTML code


The Code is as follows:


OnClick = "javascript: windows. location. href =" your url "">

3. html submit and bottom buttons to beautify css p Layout

First, prepare the button image for button beautification, and add a class style to the input submit or bottom button control. Set the button background to beautify the image, and set the border to zero, width, and height.

1. Beautify html bottom buttons

1) image materials

Save images as needed

Beautify image button Material

2) corresponding to the complete HTML source code:


The Code is as follows:





Button beautification demo on-line -www.css. com










3) bottom Effect

Bottom beautification Effect

2. Beautify the html submit button

1) image materials

Save images as needed

Right-click an image clip and choose Save as needed.

2) corresponding to the complete HTML source code:


The Code is as follows:





Submit button beautification on-line demonstration -www.css. com









3) submit button Effect

Effect after html submit beautification

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.