-1

I try to change the CSS according to the size of the screen, I tried with a simple example to understand the principle except that it did not work for me, here is my code.

    @media (max-width: 800px) {
       p{
       color: red;
        }
    }
    <head>
     <title>Css depending on screen size</title>
     <link rel="stylesheet" type="text/css" href="style.css">
    </head>
    <body>
    <p>This is a test paragraphe</p>
    </body>

Thank you for your help

theoretisch
  • 1,718
  • 5
  • 24
  • 34

1 Answers1

1

To work rule @media add section <head>:

<meta name="viewport" content="height=device-height, width=device-width, initial-scale=1">
Alex
  • 409
  • 3
  • 18