DEV Community

antony stark
antony stark

Posted on

Responsive design

Media query:-
it is used to design the webpage according to the screen size
some of the attributes of the media query are print ,orientation etc

  • The best way to responsive design is to create the webpage starting in mobile phone design
  • Mobile-First Design: Build for small screens first, then scale up layout complexity for larger displays.
  • code example
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=h1, initial-scale=1.0">
    <title>Document</title>
    <style>
        h1{
            color: aqua;
        }
        @media print {
            h1{
                color:red;
            }
        @media print and (orientation: portrait) {
            h1{
                color :grey;
            }

        }
        }
    </style>
</head>
<body>
    <h1>My Responsive Page</body>h1>
</body>
</html>
Enter fullscreen mode Exit fullscreen mode

Top comments (0)