Amaury
Well-known member
I realize this is kind of a strange question and, like with anything, it likely just comes down to personal preference. This particular CSS question has to do with borders, and being a general question, I'm not really asking for support, more just curious. (As such, if this is better suited for Forum Management, please move it accordingly. Thanks.) The question is on what's "more correct," but, again, as this likely comes down to personal preference, there's probably no "correct" answer. Still, I'm curious, and I want to see others' feedback.
Let's say you have an element that only has top and bottom borders that are red and you want to make them blue. Would it be "more correct" to use:
Or:
Similarly, now let's say you want to add right and left borders to that element. Would it be "more correct" to use:
Or:
Reason being that there are already top and button borders, so why use the general "border"? It's basically like you're stacking on top of the already-existing top and bottom borders, though not really, visually, but still.
Or:
For similar reasons as above. You already have the color.
Let's say you have an element that only has top and bottom borders that are red and you want to make them blue. Would it be "more correct" to use:
Code:
border-color: blue;
Or:
Code:
border-top-color: blue;
border-bottom-color: blue;
Similarly, now let's say you want to add right and left borders to that element. Would it be "more correct" to use:
Code:
border: solid 1px blue;
Or:
Code:
border-right: solid 1px blue;
border-left: solid 1px blue;
Reason being that there are already top and button borders, so why use the general "border"? It's basically like you're stacking on top of the already-existing top and bottom borders, though not really, visually, but still.
Or:
Code:
border-right-style: solid;
border-right-width: 1px;
border-left-style: solid;
border-left-width: 1px;
For similar reasons as above. You already have the color.