Sabtu, 02 April 2016

Memahami Grid pada Boostrap Latihan 2

Grid adalah struktur dua dimensi yang terdiri dari sumbu horizontal dan vertikal, sehingga akan tersusun kolom dan baris.

Sistem Grid terdiri dari 3 komponen yaitu Container, Baris dan Kolom.

Contoh :

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <title>2.1. Kelas Kontainer</title>

    <!-- Bootstrap -->
    <link href="css/bootstrap.min.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
<style media="all">
.container{border: solid 1px #000;margin-top:20px;background:#eee;height:100px;} 
</style>
  </head>
  <body>
<div class="container">


</div>
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <!--script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script-->
<script src="js/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="js/bootstrap.min.js"></script>
  </body>
</html>
========================================================================menjelaskan script di atas berwarna hijau :

Deklarasikan dalam sytle media
berada di bawah  <![endif]-->

<style media="all">
.container{border: solid 1px #000;margin-top:20px;background:#eee;height:100px;}
</style>
atau
<style media="all">
.container-fluid{border: solid 1px #000;margin-top:20px;background:#eee;height:100px;}
</style>
dan di atas </head>

.Container maka lebar kontainer maksimum tergantung pada jenis alat (PC, Tablet, Notebook, Handphone dsb)


Script dibawah </Head> dibuatkan  sebagai berikut :

<div class="container"><!-- Posisi di tengah sesuai table yang di buat 


</div>
atau
<div class="container-fluid"><!-- posisi di sesuaikan lebar layar full


</div>




========================================================================
Contoh ke 2 :

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <title>2.2. Kelas Kontainer-fluid</title>

    <!-- Bootstrap -->
    <link href="css/bootstrap.min.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
<style media="all">
.container-fluid{border: solid 1px #000;margin-top:20px;background:#eee;height:100px;} 
</style>
  </head>
  <body>
<div class="container-fluid">


</div>
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <!--script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script-->
<script src="js/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="js/bootstrap.min.js"></script>
  </body>
</html>
========================================================================
isi pada container
{border: solid 1px #000;margin-top:20px;background:#eee;height:100px;}

Tidak ada komentar:

Posting Komentar