Home>Article>Web Front-end> How to set image button in html
htmlHow to set a picture button: first create an HTML sample file; then create a button through the button tag; and finally set the picture through the background attribute.
The operating environment of this article: Windows7 system, HTML5&&CSS3 version, Dell G3 computer.
Turn pictures into buttons in html
The code is as follows:
Related introduction:
tag To collect user information.
According to different type attribute values, the input field has many forms. Input fields can be text fields, checkboxes, masked text controls, radio buttons, buttons, etc.
Background shorthand property sets all background properties in one declaration.
You can set the following properties:
background-color
background-position
background-size
background-repeat
background-origin
background-clip
background-attachment
background-image
If one of the values is not set, it will not There will be problems, such as background:#ff0000 url('smiley.gif'); is also allowed.
It is generally recommended to use this attribute instead of using individual attributes separately, because this attribute is better supported in older browsers and requires fewer letters to be typed.
【Recommended learning:html video tutorial】
The above is the detailed content of How to set image button in html. For more information, please follow other related articles on the PHP Chinese website!