ist Wie kann ich die Position eines Div ändern, wenn der zweite nicht verfügbar ist, zum Beispiel:Wie kann ich ein zwei divs anspricht, wenn die ersten nicht verfügbar
Also, wenn die Div2 ist nicht verfügbar Ich brauche, dass das Div1 den Platz des Div2 übernimmt, wie es im Bild der Rechten zeigt.
Hier ist der Code
.fu-article-img {
img {
position: relative;
z-index: -1;
width: 100%;
max-width: 100%;
}
.label {
font-family: $font-open-sans;
font-size: 12px;
font-weight: bold;
position: absolute;
right: 15px;
display: table;
padding: 5px 10px;
border-radius: 0;
&.fu-category {
margin-top: -55px;
}
&.fu-category-tag {
margin-top: -33px;
color: #324358;
background-color: white;
}
}
}
<div class="fu-article-img">
<a href="#" itemprop="url">
<img src="http://animals.sandiegozoo.org/sites/default/files/juicebox_slides/koala_ecalypt.jpg" title="A Different C.L.A.S.S. of Sustainability" alt="A Different C.L.A.S.S. of Sustainability" class="img-responsive" />
</a>
<a href="#">
<div class="label label-primary fu-category">
div1blablala
</div>
</a>
<a href="#1">
<div class="label label-primary fu-category-tag">
div2blablala
</div>
</a>
</div>
ist es immer entweder 1 oder 2, oder Sie wollen es für eine beliebige Anzahl von Divs arbeiten? –