marginやpaddingの指定には、色々な記載方法がありますので記載しておきます。

/* 上、右、下、左 各1行ずつ書く方法 */
.test{
    margin-top:10px;
    margin-bottom:20px;
    margin-left:30px;
    margin-right:40px;
}

/* 上、右、下、左をまとめて1行で記載する方法 */
.test{
    margin:10px 40px 20px 30px;
}

/* ショートハンド(省略系)を使用して記載 */
margin:10px;/*上右下左*/
margin:10px 20px;/*上下、左右*/
margin:10px 20px 30px;/*上、左右、下*/

ちなみにショートハンドの指定は、margin,padding,border,background,font のプロパティーに使用できます。

[対象]
CSS3
CSS2.1
CSS2