Please let me know what you mean by didn’t work.
The code didn’t make any changes in mobile or it does not change to your requirement.
I used firebug to produce the codes before providing them to you.
It works on firebug and it should work on your website, if it does not produce any changes.
Please check for syntax errors of other custom css codes you had.
If you have a cache plugin, Please clear your cache content after applying the codes, you will also need to clear your mobile browser history.