Ich kann nicht herausfinden, was mit diesem Code falsch ist. Die Hintergrundfarbe ändert sich nicht, sie bleibt nur die ganze Zeit weiß.Ändern der Hintergrundfarbe basierend auf der Browsergröße in CSS
<style type="text/css">
h1 {
position: absolute;
text-align: center;
width: 100%;
font-size: 6em;
font-family: Roboto;
transition: all 0.5s;
}
@media screen and (min-width: 0px) and (max-width: 400px) {
background-color: red;
}
@media screen and (min-width: 401px) and (max-width: 599px) {
background-color: green;
}
@media screen and (min-width: 600px) {
background-color: blue;
}
</style>
Haben Sie eine Demo zu zeigen, haben? –