Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Border-radius with percentage value not supported in Android Browsers

Is there a known issue using % values in border radius on Android browsers?

I notice that when I use:

.element {
  -webkit-border-radius: 10px;
  -moz-border-radius: 10px;
  border-radius: 10px;
}

The border radius seems to work on all mobile browsers, but when I use:

.element {
  -webkit-border-radius: 50%;
  -moz-border-radius: 50%;
  border-radius: 50%;
}

The border radius does not apply on Android browsers.

like image 802
Tithos Avatar asked Dec 07 '13 00:12

Tithos


People also ask

What is the difference between border and border radius?

The only difference between them is the right button has a radius of 5px applied. As with borders, radius allows you to set different properties for each side of the element using the toggle controls.

How do four values work on border radius?

CSS Syntax Note: The four values for each radius are given in the order top-left, top-right, bottom-right, bottom-left. If bottom-left is omitted it is the same as top-right. If bottom-right is omitted it is the same as top-left. If top-right is omitted it is the same as top-left.

Which CSS type is used to set the border radius?

The border-radius CSS property rounds the corners of an element's outer border edge. You can set a single radius to make circular corners, or two radii to make elliptical corners.

What is a good border radius?

3–4px Radius: This is best and probably the most safe choice. 3–4px is in every point of standard across multi fields, expressing a little bit more friendly and accommodating then 0px.


1 Answers

Yes there is: check here, and click on known issues.

Here's what it says:

1. Android Browser 2.3 does not support % value for border-radius.

2. Border-radius does not work on fieldset elements in IE9.

3. The stock browser on the Samsung Galaxy S4 with Android 4.2 does not support the "border-radius" shorthand property but does support the long-hand properties for each corner like "border-top-left-radius".

What are you using the percentage value for? Please tell us, so we can further help you.

Now, since you are using it to make circles, there's a dirty hack you can use:

#circle {
  border-radius: 9999px; /* makes it a circle */
}

That should work fine.

like image 56
Lucas Avatar answered Sep 22 '22 00:09

Lucas