0
0
CSSmarkup~10 mins

Border radius in CSS - Browser Rendering Trace

Choose your learning style9 modes available
Render Flow - Border radius
Parse CSS selector
Match element with border-radius
Calculate radius values
Apply clipping to corners
Repaint element with rounded corners
Composite layers
The browser reads the CSS, finds elements with border-radius, calculates the curve for each corner, clips the corners accordingly, repaints the element with smooth rounded edges, and then composites the final image.
Render Steps - 3 Steps
Code Added:width: 12rem; height: 6rem; background-color: #4a90e2;
Before
[ ]
(empty box, no size or color)
After
[____________]
[            ]
[            ]
[____________]
(blue rectangle, sharp corners)
The box now has size and a blue background, so it appears as a solid rectangle with sharp corners.
🔧 Browser Action:Creates box layer with specified size and background color
Code Sample
A blue rectangular box with white centered text and smooth rounded corners.
CSS
<div class="box">Rounded Box</div>
CSS
.box {
  width: 12rem;
  height: 6rem;
  background-color: #4a90e2;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 1.5rem;
}
Render Quiz - 3 Questions
Test your understanding
After applying step 3, what visual change do you see on the box?
AThe text moves to the top-left corner
BThe corners become smoothly rounded
CThe box changes color
DThe box size increases
Common Confusions - 3 Topics
Why do my corners not look rounded even after adding border-radius?
If the element has no visible background or border, the rounding won't be visible. Also, if the radius is very small compared to the element size, it might look like sharp corners.
💡 Make sure the element has background or border color and use a noticeable radius value.
Why does border-radius not work on images?
Images are replaced elements and sometimes overflow their container. You need to set overflow: hidden on the container or apply border-radius directly to the image with display: block.
💡 Use overflow: hidden on parent or set display: block on image with border-radius.
Why does border-radius create an ellipse instead of a circle?
If width and height are not equal, a 50% border-radius creates an ellipse. To get a perfect circle, width and height must be the same.
💡 Equal width and height + border-radius: 50% = circle.
Property Reference
PropertyValue AppliedCorners AffectedVisual EffectCommon Use
border-radius1.5remAll four cornersSmooth rounded corners on all edgesGeneral rounding of boxes
border-top-left-radius2remTop-left corner onlyRounds only the top-left cornerCustom corner rounding
border-bottom-right-radius0.5remBottom-right corner onlySlight rounding on bottom-right cornerSubtle corner style
border-radius50%All cornersCreates a circle or ellipse if width=heightMaking circles or pills
Concept Snapshot
border-radius rounds the corners of boxes. Use values like px, rem, or %. border-radius: 1.5rem rounds all corners equally. border-top-left-radius rounds one corner. 50% radius makes circles if width=height. Works best with visible backgrounds or borders.