Lets say i use the shorhand background property defining multiple properties..eg:
.img
{
background: url('/Content/images/a.png') no-repeat scroll 100% 3px;
}
If i now want to override just the background-postion of the image, should I use the full shorthand notation with the updated position like:
.img
{
background: url('/Content/images/a.png') no-repeat scroll 0 3px;
}
or just override the background-position property like:
.img
{
background-position: 0 3px;
}
If so, what are the issues? Is there a slight performance gain by only overriding the position?
Just override the property you need. In fact, this technique is very often used in so-called CSS Sprites:
This approach (you first define a generic full rule, then specify it for each particular class with a shorthand rule) has two obvious advantages: