How do i change the background color of a div with screens smaller than 200px?

Issue

I have this code

<div id="changeBackgroundColor"> content <div>

.changeBackgroundColor{
 background-color: green;
}

@media only screen and (width <= 200px){
   .changeBackgroundColor{
      background-color: green;
}

it seems to have some syntax error

Solution

I would try:

<div id="changeBackgroundColor"> content <div>

#changeBackgroundColor{
 background-color: green;
}

@media only screen and (max-width 200px){
   #changeBackgroundColor{
      background-color: green;
}

Answered By – Lucas John

Answer Checked By – Robin (AngularFixing Admin)

Leave a Reply

Your email address will not be published.