I'm making a photo gallery, and I have four elements per row.
I have a margin for the space between images.
.picDesc {
float: left;
margin:0 1% 1% 0; /* <--- this */
width: 24.2%;
text-align: center;
}
Obviously I don't need the margin for the last div on the right.
So I use nth-child for remove the margin of the fourth div.
.picDesc:nth-child(4n+4){
margin:0 0% 1% 0;
}
And works!
But when I click on an album, for example "Altro", and show the pics of this album, the margins are wrong how you can see.
How can I resolve this?
Thanks for the help!!