divs i .css,Getting CSS divs to appear left

I'm really new to CSS and I'm having some issues with divs. I'm not quite sure how to word my question correctly and am unfamiliar with a lot of the terminology used, so I'm having trouble finding the answer to my question.

Basically, my goal is to have a container that holds several square or rectangular divs at different sizes (160x160px, 320x320px and 160x320px) so that they can be displayed in a responsive grid.

The issue I'm having is that sometimes the larger divs will 'push' things away from them; for example, the smaller divs will not appear to the left of the bottom half of the 320x320 div class.

The CSS I've written looks like this;

body{

max-width: 1280px;

background-color: #333333;

}

div{

border: 1px solid #333333;

height: 158px;

width: 158px;

float: left;

text-align: center;

background-color: #cc00ff;

display: block;

float: left;

vertical-align: text-bottom;

}

.extra{

height: 158px;

width: 318px;

background-color: #ccff00;

}

.feature{

height: 318px;

width: 318px;

background-color: orange;

}

I have this linked in the HTML pasted below with about 20 divs, some with the classes for the div.

Article Title
Article Title
Article Title
Article Title
Article Title
Article Title
Article Title
Article Title
Article Title
Article Title
Article Title
Article Title
Article Title
Article Title
Article Title
Article Title
Article Title
Article Title
Article Title
Article Title
Article Title
Article Title
Article Title
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值