6 resim içeren bir div kabı oluşturmak istiyorum. Bu kapsayıcı içindediv container 6 satır öğesini sonraki satırda itti
daha sonra 6 resim olmalı, bu yüzden css içinde :nth-child()
seçici kullandı: İşte bir görüntüdür. Benim problemim şu ki, 6. görüntü bir sonraki satırda zorlanıyor ve nedenini bilmiyorum.
*{
margin: 0px;
padding: 0px;
}
div{
width: 750px;
background-color: grey;
}
div > a{
display: inline-block;
height: 120px;
width: 120px;
max-height: 120px;
max-width: 120px;
margin-right: 6px;
}
div > a:nth-child(6n){
margin-right: 6px;
}
div > a > img{
height: 120px;
width: 120px;
max-height: 120px;
max-width: 120px;
}
<div>
<a>
<img src="http://lorempixel.com/120/120/"/>
</a>
<a>
<img src="http://lorempixel.com/120/120/"/>
</a>
<a>
<img src="http://lorempixel.com/120/120/"/>
</a>
<a>
<img src="http://lorempixel.com/120/120/"/>
</a>
<a>
<img src="http://lorempixel.com/120/120/"/>
</a>
<a>
<img src="http://lorempixel.com/120/120/"/>
</a>
</div>
bir JSFiddle
Teşekkür! Ve ben css kodumda bir sorun olduğunu düşündüm. – MyNewName