cześć
czy można za pomocą CSS określić wygląd divów na stronie (szerokość) - na przemian (jak poniżej):
2 wąskie, 1 szeroki
1 szeroki, 2 wąskie
itd...
Obrazowo, to coś takiego:
[] [] [__]
[__] [] []
[] [] [__]
[__] [] []
itd...
Proszę o pomoc.
.artimg { background-clip:content-box; display:block; height:210px; width:565px; overflow:hidden; } .art { width:272px; height:300px; background:#eee; float:left; background-clip:content-box; display:block; overflow:hidden; } .art:nth-child(3n+1) { clear:left; } .art:nth-child(3n+3), .art:nth-child(6n+4) { width:565px; background:#ccc; } .art:nth-child(6n) { width:272px; background:#eee; } .art img { max-width:565px; }
<article class="art"> <a href="" class="artimg"><img src="{{ asset("images/" ~ new_article.image) }}" /></a> </article> {% endfor %}
.art:nth-child(6n) img{ max-width: 272px; }