Can I use shorthand margin syntax to change just left and right values?

Viewed 3012

Can I use the shorthand margin syntax if I want to add margin-left: auto and margin-right: auto while leaving the margin-top and margin-bottom alone?

The basic idea:

.center {
    margin: dont-specify auto;
}

Thanks!

Edit: In short, the answer is that there is no such keyword. For clarity, by 'dont-specify', I did not mean 'remove-specification', 'roll-back-specification' or 'specify-with-lower-specificity'. I meant, 'this rule should not specify a new value'. I take responsibility for being unclear. It is indeed very easy to interpret 'dont-specify' a multitude of different ways! Thanks for everyone's answers!

5 Answers
Related