Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

Level 11 lesson 2 - media queries pls help

<!DOCTYPE html>
<html>
<head>
<title>Adding breakpoint according to device</title>
<style>
/
@media (max-width: 600px) {
body {background: #cdb4db;}
}


@media (min-width: 600px) {
body {background: #ffc8dd;}
}


@media (min-width: 768px) {
body {background: #ffafcc;}
}


@media (min-width: 992px) {
body {background: #bde0fe;}
}


@media (min-width: 1200px) {
body {background: #a2d2ff;}
}
/
</style>
</head>
<body>
<p>Resize the browser window to see how the background color of this paragraph change on different screen sizes.</p>
</body>
</html>

Change the background color for screen size less than 600px width to red.
Change the background color for screen size more than 992px width to blue.
by

1 Answer

kshitijrana14
Try this one
<!DOCTYPE html>
<html>
<head>
<title>Adding breakpoint according to device</title>
<style>

@media (max-width: 600px) {
body {background: #cdb4db;}
}


@media (min-width: 600px) {
body {background: #ffc8dd;}
}


@media (min-width: 768px) {
body {background: #ffafcc;}
}


@media (min-width: 992px) {
body {background: #bde0fe;}
}


@media (min-width: 1200px) {
body {background: #a2d2ff;}
}

</style>
</head>
<body>
<p>Resize the browser window to see how the background color of this paragraph change on different screen sizes.</p>
</body>
</html>

Login / Signup to Answer the Question.