Performance: Border radius
Border radius affects the paint and composite stages of page rendering, influencing how quickly rounded corners appear on screen.
Jump into concepts and practice - no test required
border-radius: 0.5rem; box-shadow: none;
border-radius: 50%; box-shadow: 0 0 10px rgba(0,0,0,0.5);
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| border-radius: 0.5rem; | none | none | low paint cost | [OK] Good |
| border-radius: 50% with box-shadow | none | none | high paint and composite cost | [X] Bad |
border-radius do to an element?border-radius property controls the roundness of the corners of an element.border-radius.div {
width: 100px;
height: 100px;
background-color: blue;
border-radius: 50%;
}border-radius: 50% on a square makes the corners fully rounded, forming a circle shape.div {
border-radius-top-left: 15px;
}border-top-left-radius.border-radius-top-left, which is invalid CSS syntax.