jueves, 27 de febrero de 2014

Tipos de botones y grupo de botones en Bootstrap 3


Bienvenid@s, en esta ocasión vamos a ver la capacidad de Bootstrap en lo que respecta a la creación de botones y grupos de botones personalizados, el buen gusto por el diseño está a la vista y sin tener que escribir una sola línea de código CSS, a continuación veremos algunos ejemplos listos sólo para copia, pegar y probar ...

Ejemplo 1 - Tipos de botones

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Tipos de botones Bootstrap 3</title>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css">
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
    <!-- HTML5 Shim and Respond.js 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/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <body>
   <div class='container'>
   <p class='text-info'>Tipos de botones</p>
  <button type="button" class="btn btn-default">button default</button>
  <button type="button" class="btn btn-danger">button danger</button>
  <button type="button" class="btn btn-info">button info</button>
  <button type="button" class="btn btn-success">button success</button>
  <button type="button" class="btn btn-warning">button warning</button>
  <button type="button" class="btn btn-primary">button primary</button>
   </div>
  </body>
</html>


Ejemplo 2 - Grupo de botones

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Grupo de botones Bootstrap 3</title>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css">
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
    <!-- HTML5 Shim and Respond.js 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/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <body>
   <div class='container'>
   <p class='text-info'>Grupo de botones</p>
   <div class='btn-group'>
  <button type="button" class="btn btn-default">button default</button>
  <button type="button" class="btn btn-danger">button danger</button>
  <button type="button" class="btn btn-info">button info</button>
  <button type="button" class="btn btn-success">button success</button>
  <button type="button" class="btn btn-warning">button warning</button>
  <button type="button" class="btn btn-primary">button primary</button>
  </div>
   </div>
  </body>
</html>


Ejemplo 3 - Tamaño del grupo de botones


<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Tamaño del grupo de botones Bootstrap 3</title>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css">
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
    <!-- HTML5 Shim and Respond.js 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/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <body>
   <div class='container'>
   <!-- GRANDE -->
   <p class='text-info'>Tamaño del grupo de botones</p>
   <div class='btn-group btn-group-lg'>
  <button type="button" class="btn btn-default">button default</button>
  <button type="button" class="btn btn-danger">button danger</button>
  <button type="button" class="btn btn-info">button info</button>
  <button type="button" class="btn btn-success">button success</button>
  <button type="button" class="btn btn-warning">button warning</button>
  <button type="button" class="btn btn-primary">button primary</button>
  </div>
  
  <!-- NORMAL -->
     <div class='btn-group'>
  <button type="button" class="btn btn-default">button default</button>
  <button type="button" class="btn btn-danger">button danger</button>
  <button type="button" class="btn btn-info">button info</button>
  <button type="button" class="btn btn-success">button success</button>
  <button type="button" class="btn btn-warning">button warning</button>
  <button type="button" class="btn btn-primary">button primary</button>
  </div>
  
  <!-- MEDIANO -->
     <div class='btn-group btn-group-sm'>
  <button type="button" class="btn btn-default">button default</button>
  <button type="button" class="btn btn-danger">button danger</button>
  <button type="button" class="btn btn-info">button info</button>
  <button type="button" class="btn btn-success">button success</button>
  <button type="button" class="btn btn-warning">button warning</button>
  <button type="button" class="btn btn-primary">button primary</button>
  </div>
  
    <!-- PEQUEÑO -->
     <div class='btn-group btn-group-xs'>
  <button type="button" class="btn btn-default">button default</button>
  <button type="button" class="btn btn-danger">button danger</button>
  <button type="button" class="btn btn-info">button info</button>
  <button type="button" class="btn btn-success">button success</button>
  <button type="button" class="btn btn-warning">button warning</button>
  <button type="button" class="btn btn-primary">button primary</button>
  </div>
   </div>
  </body>
</html>


No hay comentarios: