Simply talk about your understanding of the HTM and CSS in the circle.

Source: Internet
Author: User
Tags border image

In recent days, in the use of CSS editing, found that a lot of border image requirements are rectangular rounded corners or directly to draw a circle example, below and we share the view of the circle.

In this sharing, I focus on giving you some examples to better understand,

We all know that when we draw a circle we use "Border-radius:", and each time we draw a circle, we should set a width and height first.

So we can understand that,

Our circle is clipped in a rectangle (square), and Border-radius is the size we want to crop.

Give you some pictures, better to understand.

First, we set a square with a width of 100px and a height of 100px, set to a red background, as follows

Next, we add the following

border-radius:50px 0 0 0, the effect is as follows:

border-radius:50px 50px 0 0; the effect is as follows:

border-radius:50px 50px 50px 0, the effect is as follows:

border-radius:50px 50px 50px 50px, the effect is as follows:

By adding the code in step by step above, the picture is changed one step at a-I understand the following:

border-radius:0 0 0 0;

Of the four values, the first value is the circle radius of the upper-left corner of the rectangle (1/4 of the circle);

The second value is the circle radius of the upper-right corner of the rectangle (1/4 circle);

The third value is the circle radius of the lower-right corner of the rectangle (1/4 circle);

The fourth value is the circle radius of the lower-left corner of the rectangle (1/4 circle);

Also, they take a radius value on the boundary of the rectangle and then determine the center of the circle (this completes the rectangular fillet, which is achieved by changing the radius.) )

The above is my understanding of Border-radius, what is wrong, welcome comments.

Simply talk about your understanding of the HTM and CSS in the circle.

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.