我正在创建一个产品网格,在这些网格中,它们保持对齐,并且总是以这样的方式进行:http://i.imgur.com/dlUPvPf.jpg
这个班将负责以这样的方式组织产品:
.center_conteudo ul.Dot_ListaProdutosULClass li.Dot_ListaProdutosLIClass { 宽度:188; 最小高度:218 min; 边缘:0 12 px30 px0; float:左; 背景:url(“./imagens/produto_img_prtieira.png”)不重复0px 125 0px; }
最后一种形式是通过这种方式获得http://bit.ly/1nUyEJo
帮帮我拜托!(谢谢;)
发布于 2014-05-17 18:35:09
如果您有一个固定的网格,每行有四个元素,并且希望每5个元素都插入一个新行,则可以使用nth-child:
element:nth-child(4n - 3) {
clear: both;
}在您的示例中,这是:
.center_conteudo ul.Dot_ListaProdutosULClass li.Dot_ListaProdutosLIClass:nth-child(4n - 3) {
clear: both;
}请注意,一些旧版本的IE不支持:nth-子选择器。
https://stackoverflow.com/questions/23714578
复制相似问题