DEV Community

Cover image for CSS Quickies: border-radius

CSS Quickies: border-radius

Michael "lampe" Lazarski on June 30, 2019

What is CSS Quickes? I started to ask my beloved community on Instagram: "what CSS properties are confusing for you?" In "CSS Quickies"...
Collapse
 
adam_cyclones profile image
Adam Crockett πŸŒ€ • Edited

A useful yet useless thing you can do to get the roundest corner.

Instead of border-radius: 9999em;

Use border-radius: 9e9em;

The result is 9 to the power of 9. So that's a big number πŸ˜…

Collapse
 
awwsmm profile image
Andrew (he/him)

MAXIMUM ROUND

Collapse
 
adam_cyclones profile image
Adam Crockett πŸŒ€

Hahaha can't cut yourself on this roundness.

Collapse
 
lampewebdev profile image
Michael "lampe" Lazarski

Haha yeah, that is also a solution!

Collapse
 
tuxhedoh profile image
Tuxhedoh

I feel like you did a good job showing examples as well as defining the radius, but I don't know from reading why we get the shapes we do from the radius. How does this number get applied to the corners of our elements? Why does 50% on a square element, turn it into a circle? I'm not trying to be critical of your post, these were just answers I was hoping to find as I read through.

Collapse
 
lampewebdev profile image
Michael "lampe" Lazarski

Thank. I was thinking of integrating it!

There is this wonderful StackOverflow answer how it is calculated:
stackoverflow.com/questions/299664...

Collapse
 
paul_duvall profile image
Paul Duvall

Thanks - a handy reminder! I keep on meaning to try out some more elaborate border-radius's (did that need the extra 's'...I'm not sure) in a project and you reminded me!

Fancy border radius is a handy site for experimenting with border-radius

Collapse
 
lampewebdev profile image
Michael "lampe" Lazarski

Fancy border-radius is a great way to create crazy shapes :)

Collapse
 
awwsmm profile image
Andrew (he/him)

This is a great series, Michael, thanks for writing it. I've bookmarked it for future reference :)