jemand anders
Erfahrenes Mitglied
Hallo,
hat jemand eine Idee, wie ich .div2 auf Grün setze, wenn .div1 Blau ist? Falls das überhaupt geht.
Danke!!
hat jemand eine Idee, wie ich .div2 auf Grün setze, wenn .div1 Blau ist? Falls das überhaupt geht.
Danke!!
HTML:
<html>
<head>
<title>Test</title>
<style>
div {
height: 50px;
width: 50px;
display: inline-block;
background-color: red
}
.div1.blue {
background-color: blue
}
.div1.blue + .div2.green {
background-color: green
}
</style>
</head>
<body>
<div> </div>
<div class="div1 blue"> </div>
<div class="div2 green"> </div>
<div class="div2 green"> </div>
<div class="div2 green"> </div>
</body>
</html>
Zuletzt bearbeitet: