Das wird nicht so einfach sein. Probiere mit den Devtools mal diese zwei Möglichkeiten hier, dann wirst du sehen, wo das Problem liegt.
1.
PHP-Code:
.ce_gallery > ul {
text-align: justify;
}
.ce_gallery > ul li {
display: inline-block;
}
2.
PHP-Code:
.ce_gallery > ul {
display: flex;
flex-wrap: wrap;
justify-content: center; /* center|space-around|space-between|space-evenly */
}
Deshalb würde ich dir empfehlen die Spaltenanzahl anzugeben und dann so ein CSS zu benutzen.
PHP-Code:
.ce_gallery .cols_1 li {
width: 100%;
}
.ce_gallery .cols_2 li {
width: 50%;
}
.ce_gallery .cols_3 li {
width: 33.3333%;
}
.ce_gallery .cols_4 li {
width: 25%;
}
.ce_gallery .cols_5 li {
width: 20%;
}
.ce_gallery .cols_6 li {
width: 16.6666%;
}
Dies könntest du dann über einen media query wieder auflösen.
PHP-Code:
/* 480px or less */
@media (max-width: 480px) {
.ce_gallery .cols_1 li,
.ce_gallery .cols_2 li {
width: 100%;
.ce_gallery .cols_3 li {
width: 50%;
}
.ce_gallery .cols_4 li,
.ce_gallery .cols_5 li,
.ce_gallery .cols_6 li {
width: 33.3333%;
}
}
Lesezeichen