Priyanshu_Gupta

Responsive

Apr 17th, 2020
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.91 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <title>Responsive | Website</title>
  5. </head>
  6. <style type="text/css">
  7.     body{
  8.         text-align: center;
  9.         background-color: black;
  10.         color: white;
  11.         padding-top: 100px;
  12.  
  13.     }
  14. h1{
  15.     display: none;
  16. }
  17. /*smartphones*/
  18.     @media(max-width: 500px){
  19.         body{
  20.              background-color:  red;
  21.  
  22.         }
  23.    
  24.     #smartphones h1  {
  25.         display: block;
  26.     }
  27.  
  28. }
  29. /*mobiles*/
  30.     @media(min-width: 501px) and (max-width: 768px){
  31.         body{
  32.              background-color:  blue;
  33.  
  34.         }
  35.         #mobiles h1{
  36.             display: block;
  37.         }
  38. /*tablets*/
  39. @media(min-width: 769px) and (max-width: 1200px){
  40.     body{
  41.         background-color: green;
  42.     }
  43.     #tablets h1{
  44.         display: block;
  45.     }
  46. }
  47.  
  48.  
  49. </style>
  50. <body>
  51.     <div id="smartphones"><h1>Smartphones</h1></div>
  52.     <div id="mobiles"><h1>Mobiles</h1></div>
  53.     <div id="tablets"><h1>Tablets</h1></div>
  54.     <div id="iPad"><h1>iPad</h1></div>
  55.     <div id="landscape"><h1 >Landscape</h1></div>
  56.  
  57. </body>
  58. </html>
Add Comment
Please, Sign In to add comment