The rounded corners of the CSS3

Source: Internet
Author: User

CSS3 Round corner Border-radius is also more commonly used, with rounded corners, can be a lot less pictures:)

Grammar:

Border-radius:none | <length>{1,4} [/<length>{1,4}]?

Description: Length cannot be a negative value. Border-radius is an abbreviated method. If the value before and after "/" is present, then the value in front of "/" is set to its horizontal radius, and the "/" after face value sets its vertical radius. If there is no "/", the horizontal and vertical radii are equal. In addition, the four values are set according to the order of Top-left, Top-right, Bottom-right, Bottom-left.

A simple example:

<!DOCTYPE HTML><HTML><Head><style>#radius{text-align:Center;Border:2px solid #a1a1a1;padding:10px 40px;background:#dddddd;width:350px;Height:200px;Border-radius:25px;-moz-border-radius:25px; }</style></Head><Body><DivID= "radius">Border-radius</Div></Body></HTML>                      

Figure:

When you set two values, the values of the diagonal are the same, Top-left and Bottom-right take the first value, and the other two corners take a different value.

<!DOCTYPE HTML><HTML><Head><style>#radius{text-align:Center;Border:2px solid #a1a1a1;padding:10px 40px;background:#dddddd;width:350px;Height:200px;Border-radius:25px 50px;-moz-border-radius:25px 50px; }</style></Head><Body><DivID= "radius">Border-radius</Div></Body></HTML>                      

Effect:

You can also set the horizontal and vertical radii for each corner separately:

border-radius:15px 30px/20px 10px;

Equivalent to:

border-top-left-radius:15px 20px;border-bottom-right-radius:15px 20px;border-top-right-radius:30px 10px; border-bottom-left-radius:30px 10px;

Effect:

In addition, when the fillet radius is less than or equal to the border thickness, the inner fillet will be square, which is also well understood, for example:

border:20px solid #a1a1a1; border-radius:20px;

Effect:

When the fillet radius is greater than the border thickness, the inside of the bounding rectangle also renders a fillet effect:

border:10px solid #a1a1a1; border-radius:20px;

Effect:

You can draw a circle with rounded corners:

<!DOCTYPE HTML><HTML><Head><style>#radius{text-align:Center;margin:50px Auto;width:0;Height:0;Border:100px Solid #a1a1a1;Border-radius:100px;}</style></Head><Body><DivID= "radius"></Div></Body></HTML>                      

Effect:

Remember that CSS3 Doraemon? is drawn with a lot of rounded corners.

The rounded corners of the CSS3

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.