块元素默认是独占一行的,如果想要几个块元素并排怎么办呢,这时候需要用到浮动(float)
实例代码如下
.floatDemo{ 100px; heigth:100px; float:left; margin:0px 30px 0px 0px; background-color:#4F94CD; }