Use the button element to customize styles of buttons

Source: Internet
Author: User
We all know that a button is defined in the web. The most common method is to use the type = 'click' of the input element '. However, in HTML spec 4.0, a button element is added, and ie4.0 has started to support <button>. As the name suggests, it is also used to define a webpage button, but it is very different from <input type = '...'>.

The biggest difference between a button element and an input element is that a button is a container type element that can contain valid HTMLCodeBy using the canhavechildren and canhavehtml Attributes provided by ie5.5, we can see that both attributes areTrue. The input element cannot contain child elements and HTML code. Its canhavechildren and canhavehtml attributes areFalse.

In this way, it is very easy to create a button with an image. For example:

< Button > < IMG Align = 'Abcddle' SRC = '/Emoticons/emnote.gif'>SingSong </Button >

Will be displayed:Sing Song.

Webpage buttons with mnemonic:

< Button Accesskey = "B" > <U> B</U>Otton </ Button >

 BOttonOf course, this cannot be automatically executed. You can only use Alt + B to focus on it. You need to use JavaScript to control the response.

Button element with any HTML content:



Text
Text
Cnblogs Texttext textsdaf
Text Cnblogs
Texttext textsdaf Cnblogs
Text
Text
Cnblogs Text
Text
Texttext textsdaf Text
Texttext textsdaf asdfsdfsdf
Cnblogs



However, this complicated embedding problem also exists. Although it can be displayed, the embedded element event cannot be triggered.

However, the button ElementNoEmbedded button elements, such as the following example:

< Button >

Outer button

< Button >

Inner button

</ Button >

</ Button >  

Will be displayed:Outer buttonInner button.

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.