Are both method valid? both works same.
border:2px solid red;
and
border:2px red solid;
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
W3.org (the official spec) says that the value for the
bordershorthand property is this:So it specifies that the order you should use is width, style, color. In other words,
border: 2px solid red;from your example.The other method is technically “undefined”, but browsers usually display it correctly because there is no confusion between the style and colour values; there is currently no colour called “solid” or “dashed”. Stick with the official method anyway.