Advertisement
Nass07

col_bootstrap.html

Jul 7th, 2016
371
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.63 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title> Memahami penggunaan kolom dan baris pada bootstrap</title>
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <link href="bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" type="text/css">
  8. </head>
  9. <body>
  10. <div class="container">
  11. <!--1 baris 12 kolom-->
  12. <div class="row">
  13. <div class="col-md-1">1</div>
  14. <div class="col-md-1">2</div>
  15. <div class="col-md-1">3</div>
  16. <div class="col-md-1">4</div>
  17. <div class="col-md-1">5</div>
  18. <div class="col-md-1">6</div>
  19. <div class="col-md-1">7</div>
  20. <div class="col-md-1">8</div>
  21. <div class="col-md-1">9</div>
  22. <div class="col-md-1">10</div>
  23. <div class="col-md-1">11</div>
  24. <div class="col-md-1">12</div>
  25. </div>
  26.  
  27. <!--1 baris 3 kolom-->
  28. <div class="row">
  29. <div class="col-xs-4">1</div>
  30. <div class="col-xs-4">2</div>
  31. <div class="col-xs-4">3</div>
  32. </div>
  33.  
  34. <!--1 baris 2 kolom-->
  35. <div class="row">
  36. <div class="col-sm-6">1</div>
  37. <div class="col-sm-6">2</div>
  38. </div>
  39.  
  40. <!--1 baris 2 kolom yang bebeda-->
  41. <div class="row">
  42. <div class="col-xs-3">1</div>
  43. <div class="col-xs-9">2</div>
  44. </div>
  45.  
  46. <!--contoh lain, sumber http://getbootstrap.com/css/ -->
  47. <!-- Stack the columns on mobile by making one full-width and the other half-width -->
  48. <div class="row">
  49. <div class="col-xs-12 col-md-8">.col-xs-12 .col-md-8</div>
  50. <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
  51. </div>
  52.  
  53. <!-- Columns start at 50% wide on mobile and bump up to 33.3% wide on desktop -->
  54. <div class="row">
  55. <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
  56. <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
  57. <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
  58. </div>
  59.  
  60. <!-- Columns are always 50% wide, on mobile and desktop -->
  61. <div class="row">
  62. <div class="col-xs-6">.col-xs-6</div>
  63. <div class="col-xs-6">.col-xs-6</div>
  64. </div>
  65. </div>
  66. <style type="text/css">
  67. .row{margin:4px 0px;}
  68. [class*="col-"] {
  69. padding:4px 8px;
  70. background-color: #eee;
  71. background-color: rgba(86,61,124,.15);
  72. border: 1px solid #ddd;
  73. border: 1px solid rgba(86,61,124,.2);
  74. }
  75.  
  76. </style>
  77. </body>
  78. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement