css3--rounded Corners

Source: Internet
Author: User

Using the CSS3 Border-radius property, you can make a fillet for any element.

Add rounded corners to the background, borders, and pictures, respectively.

<!DOCTYPE HTML><HTML><Head><MetaCharSet= "Utf-8"> <title>CSS3 Rounded Corners</title>  <styletype= "Text/css">  * {margin:0;padding:0;  }Div{width:200px;Height:150px;Line-height:150px;text-align:Center;margin:20px Auto;  }. Rcorners1{Border-radius:25px;background:#8AC007;  }. Rcorners2{Border-radius:25px;Border:2px solid #8Ac007;  }. Rcorners3{Border-radius:25px;background:URL (paper.gif) left top repeat;  }</style></Head><Body>  <Divclass= "Rcorners1">Rounded corners with background</Div>  <Divclass= "Rcorners2">Rounded corners with borders</Div>  <Divclass= "Rcorners3">Specify rounded corners of the background</Div></Body></HTML>

The effect is as follows:

If you specify only one value in the Border-radius property, 4 rounded corners are generated.

However, if you want to specify one by one on Four corners, you can use the following rules:

    • Four values: The first value is the upper-left corner, the second value is the upper-right corner, the third value is the lower-right corner, and the fourth value is the lower-left corner.
    • Three values: The first value is the upper-left corner, the second value is the upper-right corner and the lower-left corner, the third value is the lower-right corner
    • Two values: The first value is the upper-left corner and the lower-right corner, the second value is the upper-right corner and the lower-left corner
    • One value: Four fillet values are the same

We have shown a value above, the following shows the next four values, three values, two values,

Four values:

border-radius:10px 30px 50px 70px;

The effect is as follows:

Three values:

border-radius:10px 40px 10px;

The effect is as follows:

L Two values:

border-radius:10px 80px;

The effect is as follows:

Let's draw a circle, as long as the width is the same height and the size of the four corners is half the width and height is a circle

Width:200px;height:200px;border-radius:50%;background-color: #8AC007;

css3--rounded Corners

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.