rgb wrong number of arguments issue in rails:
I saw that rgb in css file takes 3 arguments as mentioned here
http://www.w3schools.com/cssref/css_colors.asp
But in my project abc.css.scss file have code like this
border: 1px solid rgb(100, 100, 100, 2);
border: 1px solid rgba(0, 0, 0, 0.2);
-webkit-box-shadow: 0px 3px 2px rgba(67, 67, 67, 0.1);
-moz-box-shadow: 0px 3px 2px rgba(67, 67, 67, 0.1);
So what is happening here. Am I missing something?
Thanks in Advance!
The short and sweet answer is when you use rgb
you can't pass an alpha property. Use rgba
to use alpha
The answer is quite self explanatory. rgb
expects 3 arguments, so you need to give it 3, not 4.
This is what you want:
border: 1px solid rgb(100, 100, 100);
border: 1px solid rgba(0, 0, 0, 0.2);
-webkit-box-shadow: 0px 3px 2px rgba(67, 67, 67, 0.1);
-moz-box-shadow: 0px 3px 2px rgba(67, 67, 67, 0.1);
Notice that the first line has changed
If you keep the 4th parameter, that first line of code will not work. It will simply be ignored and have no effect.
See this example: You will notice the square is black, because the rgb
with the 4th parameter is invalid and is therefore not applied
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With