Guest User

Untitled

a guest
Jul 17th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. <html>
  2. <head>
  3. <link rel="stylesheet" type="text/css" href="style.css" />
  4. <link rel="stylesheet" type="text/css" media="only screen and (max-width:480px)" href="css3.css" />
  5.  
  6. </head>
  7. <body>
  8. <div id="wrapper">
  9. <div id="header">
  10. <h1>Ini hanya mencoba saja lho</h1>
  11. </div>
  12. <div id="content">
  13.  
  14. Adding the specific code for devices inline might be a good way to use media queries if
  15. you only need to make a few changes, however if your stylesheet contains a lot of
  16. overwriting or you want to completely separate the styles shown to desktop browsers and those used for small screen devices, then linking in a different stylesheet will enable you to keep the CSS separate.
  17. </div>
  18. </div>
  19. </body>
  20. </html>
  21.  
  22. div#wrapper { width: 800px;}
  23. div#header{
  24. background-image:url(media_queries.png);
  25. height: 93px;
  26. position:relative;
  27. }
  28.  
  29. div#header h1{
  30. font-size:140%;
  31. }
  32. #content{
  33. float:none;
  34. width:100%;
  35. background-color:#CCC;
  36. }
  37. #navigation{
  38. float:none;
  39. width:auto;
  40. }
  41.  
  42. @media only screen and (max-width:480px){
  43. div#wrapper { width: 400px;}
  44. div#header{
  45. background-image:url(media_queries.png);
  46. height: 93px;
  47. position:relative;
  48. }
  49.  
  50. div#header h1{
  51. font-size:140%;
  52. }
  53. #content{
  54. float:none;
  55. width:100%;
  56. background-color:#8787C1;
  57. }
  58. #navigation{
  59. float:none;
  60. width:auto;
  61. }
  62. }
Add Comment
Please, Sign In to add comment