Tutorial Blogspot

Tutorial Blogspot, SEO, HTML5, CSS3, Facebook, Twitter, Software, Game, Motivasi, Tips dan Trik

Select Menu
  • Home
  • Blogging
    • Tutorial Blogspot
    • CSS
    • jQuery
    • Widget
  • Tools
    • SEO
    • Template Blogger
    • HTML Encrypter
    • Code Color
    • Responsive Cek
  • Sitemap
  • About Me
  • Link Exchange
  • Pasang Iklan
  • Kontes SEO Template Premium
Home » Blogging » Cara Mudah Membuat Design Responsif

Minggu, 31 Agustus 2014

Cara Mudah Membuat Design Responsif

Unknown
Add Comment
Blogging
Minggu, 31 Agustus 2014
Cara Mudah Membuat Design Responsif. Sebuah situs web atau blog yang baik adalah situs web dengan desain yang nyaman dan responsif yang dapat dengan mudah diakses oleh pengguna internet dari mana saja, melalui komputer atau smartphone. Pentingnya desain website responsif sebenarnya telah dibahas dalam beberapa posting sebelumnya, untuk itu di posting ini. Kami akan mengeksplorasi secara penuh, cara membuat dan membangun sebuah desain website responsif.


Cara Mudah Membuat Design Responsif

Sebenarnya ada dua cara bagaimana membuat website kita memiliki desain responsif. Cara pertama adalah dengan membuat dua versi dari desain, yang untuk desktop dan mobile versi terpisah sehingga ketika pengguna ponsel datang untuk mengunjungi, layar akan diarahkan ke versi mobile tentu jauh lebih ringan dan sederhana. Adapun cara kedua adalah dengan membuat desain khusus dengan menyesuaikan ukuran font dan layar ponsel sehingga website menjadi lebih mudah untuk melakukan akses dan membaca.

Dalam tutorial ini, kita akan membahas cara kedua, yaitu untuk membuat desain website dasar yang responsif terhadap browser layar.
Pertama, tentu saja adalah untuk membuat dokumen html.
Berikut html dasar untuk tata letak situs web:
  1. <div id="wrapper">
  2. <div id="header-wrapper">
  3. <h1>RESPONSIVE WEBSITE DESIGN</h1>
  4. </div>
  5. <div id="navigation">
  6. <h2>HOME ABOUT CONTACT</h2>
  7. </div>
  8. <div id="content-wrapper">
  9. <p> Easy Ways To Create And Build A Responsive Website Design </p>
  10. <p> Actually there are two ways how to create a website we have a responsive design. The first way is to create 2 versions of the design, which is for the desktop and mobile versions separately so that when a mobile user comes to visit, the display will be redirected to the mobile version of course much lighter and simpler. As for the second way is to create a special design with adjust the size of font and mobile screen so that the website becomes easier to access and reading.</p>
  11. </div>
  12. <div id="sidebar-wrapper">
  13. <p>Sidebar</p>
  14. </div>
  15. <div id="footer-wrapper">
  16. <p>Footer</p>
  17. </div>
  18. </div>
Kedua, pengaturan ukuran tata letak situs web. Sebagai layout default, kita akan menggunakan ukuran desktop lebar 1300px, untuk menyesuaikan panjang tata letak.
Berikut css kode untuk keseluruhan tampilan website default:
  1. #wrapper {
  2. width:1300px;
  3. margin:auto;
  4. }
  5. #header-wrapper {
  6. width:1300px;
  7. background:#90C;
  8. border:solid #555;
  9. }
  10. #navigation {
  11. width:1300px;
  12. background:#36F;
  13. border:solid #555;
  14. margin-top:5px;
  15. }
  16. #content-wrapper{
  17. width:775px;
  18. float:left;
  19. background:#900;
  20. border:solid #555;
  21. margin-top:5px;
  22. }
  23. #sidebar-wrapper{
  24. margin-left:5px;
  25. width:500px;
  26. background:#0F6;
  27. border:solid #555;
  28. float:left;
  29. margin-top:5px;
  30. }
  31. #footer-wrapper{
  32. width:1300px;
  33. border:solid #555;
  34. float:left;
  35. background:#F60;
  36. margin-top:5px;
  37. }
Berikutnya adalah membuat css kode untuk layar ponsel. Untuk mobile dan gadget dengan layar seluas 1024px dan kurang, sebagai berikut:
  1. /* for 1024px or less */
  2. @media screen and (max-width: 1024px){
  3. #wrapper {
  4. width:100%;
  5. float:none;
  6. }
  7. #header-wrapper {
  8. width:100%;
  9. background:#90C;
  10. border:solid #555;
  11. }
  12. #navigation {
  13. width:100%;
  14. font-size:0.7em;
  15. background:#30F;
  16. border:solid #555;
  17. }
  18. #content-wrapper{
  19. width:63.8%;
  20. float:left;
  21. background:#900;
  22. border:solid #555;
  23. }
  24. #sidebar-wrapper{
  25. margin-left:0.5%;
  26. width:34%;
  27. background:#0F6;
  28. border:solid #555;
  29. float:left;
  30. }
  31. #footer-wrapper{
  32. width:100%;
  33. border:solid #555;
  34. float:left;
  35. }
  36. }
Teknik ini adalah mengubah ukuran lebar dari px awalnya persentase sehingga lebar akan berubah dari 1300px menjadi 100%.
Ukuran layar browser ponsel sangat beragam, dan bahkan ada lebar ukuran 320px. Jika kita hanya menggunakan ukuran 1024px, ukuran isi dan sidebar menjadi sangat kecil. Untuk itu, konten dan sidebar akan dibuat turun dan tidak sebelah. Bagaimana melakukan? menambahkan CSS di bawah ini.
Kali ini, pengaturan layar dengan lebar 700px atau kurang.
  1. /* for 700px or less */
  2. @media screen and (max-width: 700px) {
  3.  
  4. #content-wrapper {
  5. width: auto;
  6. float: none;
  7. }
  8. #sidebar-wrapper {
  9. width: auto;
  10. float: none;
  11. }
  12.  
  13. }
Jika kita telah mengatur lebar layout website maka jangan lupa untuk mengatur ukuran font. Jangan lupa ketika ukuran font menjadi lebih kecil jika dilihat melalui mobile.
1 em = 16 px -> untuk ukuran font pada paragraph (p)
1,5 em = 24 px -> untuk h1
1.25 em = 20 px -> untuk h2
dll
Jadi kode css untuk huruf yang digunakan dalam desain website responsif adalah:
  1. h1 {
  2. font-size:2em;
  3. }
  4. h2 {
  5. font-size:1.5em;
  6. }
  7. p {
  8. font-size:1em;
  9. }
Secara keseluruhan, berikut ini adalah html dan css kode untuk membuat desain website / blog responsif.
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title> Easy Ways To Create And Build A Responsive Website Design </title>
  6. <style>
  7. #wrapper {
  8. width:1300px;
  9. margin:auto;
  10. }
  11. #header-wrapper {
  12. width:1300px;
  13. background:#90C;
  14. border:solid #555;
  15. }
  16. #navigation {
  17. width:1300px;
  18. background:#36F;
  19. border:solid #555;
  20. margin-top:5px;
  21. }
  22. #content-wrapper{
  23. width:775px;
  24. float:left;
  25. background:#900;
  26. border:solid #555;
  27. margin-top:5px;
  28. }
  29. #sidebar-wrapper{
  30. margin-left:5px;
  31. width:500px;
  32. background:#0F6;
  33. border:solid #555;
  34. float:left;
  35. margin-top:5px;
  36. }
  37. #footer-wrapper{
  38. width:1300px;
  39. border:solid #555;
  40. float:left;
  41. background:#F60;
  42. margin-top:5px;
  43. }
  44. h1 a{
  45. font-size:1.5em;
  46. text-decoration:none;
  47. }
  48. h2 {
  49. font-size:1.25em;
  50. text-decoration:none;
  51. }
  52. p {
  53. font-size:1em;
  54. }
  55. /* for 1024px or less */
  56. @media screen and (max-width: 1024px){
  57. #wrapper {
  58. width:100%;
  59. float:none;
  60. }
  61. #header-wrapper {
  62. width:100%;
  63. background:#90C;
  64. border:solid #555;
  65. }
  66. #navigation {
  67. width:100%;
  68. font-size:0.7em;
  69. background:#30F;
  70. border:solid #555;
  71. }
  72. #content-wrapper{
  73. width:63.8%;
  74. float:left;
  75. background:#900;
  76. border:solid #555;
  77. }
  78. #sidebar-wrapper{
  79. margin-left:0.5%;
  80. width:34%;
  81. background:#0F6;
  82. border:solid #555;
  83. float:left;
  84. }
  85. #footer-wrapper{
  86. width:100%;
  87. border:solid #555;
  88. float:left;
  89. }
  90. }
  91. /* for 700px or less */
  92. @media screen and (max-width: 700px) {
  93.  
  94. #content-wrapper {
  95. width: auto;
  96. float: none;
  97. }
  98. #sidebar-wrapper {
  99. width: auto;
  100. float: none;
  101. }
  102.  
  103. }
  104. </style>
  105. </head>
  106. <body>
  107. <div id="wrapper">
  108. <header id="header-wrapper">
  109. <h1><a href="#"> Easy Ways To Create And Build A Responsive Website Design </a></h1>
  110. </header>
  111. <nav id="navigation">
  112. <h2>HOME ABOUT CONTACT</h2>
  113. </nav>
  114. <aside id="content-wrapper">
  115. <p> Easy Ways To Create And Build A Responsive Website Design </p>
  116. <p> Actually there are two ways how to create a website we have a responsive design. The first way is to create 2 versions of the design, which is for the desktop and mobile versions separately so that when a mobile user comes to visit, the display will be redirected to the mobile version of course much lighter and simpler. As for the second way is to create a special design with adjust the size of font and mobile screen so that the website becomes easier to access and reading.</p>
  117. </aside>
  118. <aside id="sidebar-wrapper">
  119. <p>Sidebar</p>
  120. </aside>
  121. <footer id="footer-wrapper">
  122. <p>Footer</p>
  123. </footer>
  124. </div>
  125. </body>
  126. </html>
Dari tata letak dasar di atas, Anda dapat membangun berbagai bentuk tampilan desain website / blog responsif.
Sebagai catatan, memiliki desain website responsif seperti ini memiliki kelemahan. Jika situs Web default Anda memiliki kapasitas yang tinggi dan memiliki sidebar banyak, pengguna yang berasal dari aplikasi mobile akan tetap sulit untuk mengakses website Anda. Bila ukuran situs sangat besar, Anda harus menggunakan cara pertama yang saya sebutkan di paragraf pertama di atas. Di lain waktu saya akan membicarakannya nanti.
Saya harap tutorial ini dapat berguna bagi Anda
Suka Artikel? Bagikan: Facebook Twitter Google+

0 Comments

Berkomentarlah Dengan Sopan

Posting Lebih Baru Posting Lama Beranda
Langganan: Posting Komentar (Atom)

Statistik

Flag Counter

Label

  • Blogging
  • Css
  • jQuery
  • SEO
  • Template
  • Widget
Diberdayakan oleh Blogger.

Arsip Blog

  • ▼  2014 (41)
    • ►  September (33)
    • ▼  Agustus (8)
      • Cara Mudah Membuat Design Responsif
      • RDFa License Dan Microdata dalam Blog
      • Cara Install Dan Menambah Google Analytics Di Blogger
      • Auto Read More Thumbnail Tanpa Javascript
      • Recent Post Slideshow dengan S3Slider
      • Tabulasi Kode dalam Blog
      • Cara Mengaktifkan dan Setting Robot.txt Pada Blog
      • Cara Mudah Membuat Design Responsif

Mengenai Saya

Unknown
Lihat profil lengkapku
Copyright 2014 Tutorial Blogspot - All Rights Reserved
Template by Dino Desain - Powered Blogger