sashomaga

responsive page setup

Feb 11th, 2014
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 2.69 KB | None | 0 0
  1. <!doctype html>  
  2. <html lang="en">  
  3. <head>  
  4.   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
  5.   <title>title</title>  
  6.   <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">  
  7.   <meta name="viewport" content="width=device-width, initial-scale=1>
  8. <!--[if lt IE 9]>    
  9.    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>  
  10.    <script src="http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js"></script>  
  11.  <![endif]-->  
  12. </head>
  13.  
  14. <style>
  15. /* Smartphones (portrait and landscape) ----------- */
  16. @media only screen
  17. and (min-device-width : 320px)
  18. and (max-device-width : 480px) {
  19. /* Styles */
  20. }
  21. /* Smartphones (landscape) ----------- */
  22. @media only screen
  23. and (min-width : 321px) {
  24. /* Styles */
  25. }
  26. /* Smartphones (portrait) ----------- */
  27. @media only screen
  28. and (max-width : 320px) {
  29. /* Styles */
  30. }
  31. /* iPads (portrait and landscape) ----------- */
  32. @media only screen
  33. and (min-device-width : 768px)
  34. and (max-device-width : 1024px) {
  35. /* Styles */
  36. }
  37. /* iPads (landscape) ----------- */
  38. @media only screen
  39. and (min-device-width : 768px)
  40. and (max-device-width : 1024px)
  41. and (orientation : landscape) {
  42. /* Styles */
  43. }
  44. /* iPads (portrait) ----------- */
  45. @media only screen
  46. and (min-device-width : 768px)
  47. and (max-device-width : 1024px)
  48. and (orientation : portrait) {
  49. /* Styles */
  50. }
  51. /* Desktops and laptops ----------- */
  52. @media only screen
  53. and (min-width : 1224px) {
  54. /* Styles */
  55. }
  56. /* Large screens ----------- */
  57. @media only screen
  58. and (min-width : 1824px) {
  59. /* Styles */
  60. }
  61. /* iPhone 4 ----------- */
  62. @media
  63. only screen and (-webkit-min-device-pixel-ratio : 1.5),
  64. only screen and (min-device-pixel-ratio : 1.5) {
  65. /* Styles */
  66. }
  67. </style>
  68.  
  69. <style>
  70. body {
  71.     font: normal 100% Helvetica, Arial, sans-serif;
  72. }
  73. h1 {
  74.     font-family: Georgia, serif;
  75.     font-size: 1.5em;        /* 24px / 16px = 1.5em */
  76. }
  77. ul {
  78.     font-size: 0.875em;      /* 14px / 16px = 0.875em */
  79. }
  80. h1 {
  81.     margin-left: 14.575%;    /* 144px / 988px = 0.14575 */
  82.     width: 70.85%;           /* 700px / 988px = 0.7085 */
  83. }
  84. </style>
  85.  
  86. /* images */
  87. img {
  88.      max-width: 100%;
  89.      height:auto;
  90.      width: auto\9; /* ie8 */
  91. }
  92.  
  93.  
  94. <link rel="stylesheet" type="text/css"
  95.  media="screen and (max-device-width: 480px) and (resolution: 163dpi)"
  96.  href="some.css" />
  97.  
  98. video {
  99.     max-width: 100%;
  100.     height: auto;
  101. }
  102.  
  103. /* iframe embeded */
  104. .video-container {
  105.     position: relative;
  106.     padding-bottom: 56.25%;
  107.     padding-top: 30px;
  108.     height: 0;
  109.     overflow: hidden;
  110. }
  111.  
  112. .video-container iframe,  
  113. .video-container object,  
  114. .video-container embed {
  115.     position: absolute;
  116.     top: 0;
  117.     left: 0;
  118.     width: 100%;
  119.     height: 100%;
  120. }
Advertisement
Add Comment
Please, Sign In to add comment