Languages

CSS - how to create bean button?

3 points
Asked by:
Vanessa-Drake
718

How can I create a bean button?

I was trying border-radius property with percentage value like 30% or 50% but it makes ellipse.

My code:

I need something like this:

CSS - how to create bean button?
CSS - bean button
1 answer
3 points
Answered by:
Admin Dirask Community
4380

You shouldn't use percentage values with border-radius property.

Quick solutions:

Set border-radius property value to:

  1. 50% (or more) of button's height using some unit of: pxemrem, etc,
    e.g.
    for height: 50px border-radius: 25px
    for height: 10em border-radius: 5em
    for height: 10rem border-radius: 5rem
    etc.
  2. very big value using some unit of: pxemrem, etc,
    e.g. 1000px, 500rem or 500rem,

 

Practical example:

 

Reerences

  1. CSS values and units - Learn web development | MDN
0 commentsAdd comment
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join