This article mainly introduces the styling of the HTML button tag, as well as the beautification style of the HTML button tag, let's read this article together.
Let's first introduce the style settings for the button tag in HTML:
Normal button settings:
You can create a normal button by setting the Type property of the INPUT element to "button". The text displayed on the button is the value of the Value property, and if the Value property is not provided, only an empty button is created. Such as:
<input type= "button" value= "Buy Now" >
The effect is obvious, which is the default normal button setting.
By default, clicking on the normal button does not react. Therefore, you need to register the event for the normal button and write the appropriate handler function manually. If you want to submit the form when you click the button above, register the onclick event for the button. Such as:
<form name= "buy" action= "form.html" method= "POST" > <button onclick= "submitForm (Buy)" > Buy Now </ Button></form>
Clicking the button now triggers the onclick event and invokes the event handler SubmitForm (Buy), which is the value of the pending Form Name property. If you want to submit the form after you click the button, you can call the Submit () method of the Form object in the event handler:
function SubmitForm (f) { f.submit (); }
This is a default setting, so let's take a look at setting the HTML button tag style:
Let's show you a complete code example:
<!doctype html>
The effect of this
This effect is not very obvious, than the default time to look much better, until we learn JS, we can also use JS technology to set the default button more beautiful.
OK, the above is about the HTML button label style settings, as well as the beautification of the style of the summary (want to learn more to topic.alibabacloud.com), there are questions can be asked below.