Home > Web Front-end > CSS Tutorial > How to achieve the display effect of button rounded style with css? (example)

How to achieve the display effect of button rounded style with css? (example)

藏色散人
Release: 2018-08-15 16:22:04
Original
14017 people have browsed it

In the process of web design, the default effect of general label attributes is not very beautiful. For example, the button style, the default state is extremely ordinary and has no aesthetic feeling. So this article will introduce to you related operation examples about the rounded button effect of css setting button style.

The code is as follows:

<div style="width:100px;height:50px;background-color:red;border-radius:15px;">
Copy after login

or

<input type="button" value=" " style="border-radius:5px;" />
Copy after login

The effect is as follows:

How to achieve the display effect of button rounded style with css? (example)

After reading the above code Don't you think it's very simple? In fact, the key to setting the rounded rectangle button style in HTML is the border-radius
attribute in CSS. As long as you master the essential usage of this attribute, you can easily set rounded corners for divs, pictures, or border buttons.

Introduction to key knowledge points: The border-radius attribute is a composite attribute that can specify up to four border -*- radius attributes. This attribute allows you to add a rounded border to an element!

border-radius: 1-4 length|% / 1-4 length|%;
Copy after login

The order of the four values ​​for each radius is: upper left corner, upper right corner, lower right corner, lower left corner. If the lower left corner is omitted, the upper right corner is the same. If the lower right corner is omitted, the upper left corner is the same. If the upper right corner is omitted, the upper left corner is the same.

So this article’s introduction to setting the rounded corner style of CSS buttons will be helpful to friends in need.




The above is the detailed content of How to achieve the display effect of button rounded style with css? (example). For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template