Background frame radius cannot work
I have installed webview on Android 2.x. I want my button to have border-radius
and background-color
. I am specifying these values in CSS for both, however it doesn't work.
When I set the values separately, it works.
Any ideas why this doesn't work when I specify all values at once?
Html
<button class="btn">click</button>
CSS
.btn{/*border radius does not work*/
-webkit-border-radius: 12px;
-moz-border-radius: 12px;
border-radius: 12px;
background-color:green;
}
.btn{/*works*/
border-radius:12px;
}
.btn{/*works*/
background-color:green;
}
source to share
This should work on any Android 1.6 as mentioned in CSS-tricks .
button{
-moz-border-radius: 12px;
-webkit-border-radius: 12px;
border-radius: 12px;
background-color:green;
}
<button>click</button>
Another option for creating a button in HTM5L and CSS3 would use a tag a
. For example:
a{
background-color:green;
text-decoration:none;
-webkit-border-radius:12px;
-moz-border-radius:12px;
border-radius:12px;
color:black;
padding:5px;
cursor:pointer;
}
<a href="/" alt="">click</a>
Or you can try using the tag <input>
for type="button"
or type="submit"
. More details here . For example:
input{
background-color:green;
-webkit-border-radius:12px;
-moz-border-radius:12px;
border-radius:12px;
}
<input type="button" value="click">
<input type="submit" value="click">
If any of these methods don't work for you, then there is a high chance that other CSS or JavaScript settings are causing this. And you will need to add some extra code to your question.
source to share