*{margin:0;padding:0;} .a{width:300px;height:300px; background:#ccc;} .b{width:100px;min-height:50px;max-height:100px; background:red;} .b{margin:0 auto;}