zu verwenden, aber dies unterbricht das Element "Inhalt" im Div -Stil. Hier ist der Code: < /p>
Code: Select all
function newCreation(img, label) {
const creation = document.createElement("div");
creation.style.content = "url(Media/Creations/" + img; + ")"
document.getElementById("creationsCont").appendChild(creation);
}< /code>
#creationsCont {
width: 100%;
display: flex;
justify-content: center;
height: 250px;
flex-wrap: wrap;
}
#creationsCont div {
object-fit: contain;
padding: 5px;
width: 400px;
height: 250px;
margin-right: 10px;
margin-left: 10px;
border-radius: 15px;
margin-bottom: 10px;
border-color: #616161;
border-width: 2px;
border-style: solid;
box-sizing: border-box;
background-color: rgb(21, 12, 31);
flex-shrink: 0;
}< /code>