Dev.to WebDev πŸ›  Dev πŸ‘ 0

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 m

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>
πŸ“° Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.