Set button color in jQuery mobile?

I have a jQuery mobile app. This application has one button that I need to give a special color.

In other words, there is only one button in this application that uses this color. I need to install it through CSS.

I currently have the following:

<input type="button" value="My Button" style="background-color:#00ff21;" /> 

This approach changes the color of the button. However, the color fades. At first I did not believe, so I tried:

 <input type="button" value="My Button" style="background-color:yellow;" /> 

It is very clear that the color of the button is pale. How to set the color of the button so that it does not disappear?

+4
source share
2 answers

Your problem is with the jQM style of an input type button element. Your case will not work, because you also need to set the opacity to 1:

 opacity: 1; 

Opacity is the main reason why the color looks pale.

Unfortunately this will not work. I am not going to explain why, try this for yourself and see the difference.

Only in this way can you create a button like this:

 <a data-role="button" id="custom-btn" style="background:yellow;">Custom Button</a> 

Real-time example: http://jsfiddle.net/Gajotres/bfMNu/

+2
source

add style background-color:yellow !important

0
source

Source: https://habr.com/ru/post/1469522/


All Articles