Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jul 30th, 2012  |  syntax: None  |  size: 3.48 KB  |  views: 176  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Center Form using Twitter Bootstrap
  2. <!DOCTYPE html>
  3. <html lang="en">
  4.   <head>
  5.     <meta charset="utf-8">
  6.     <title>My Form</title>
  7.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8.     <meta name="description" content="">
  9.     <meta name="author" content="">
  10.  
  11.     <!-- Le styles -->
  12.     <link href="/bootstrap/css/bootstrap.css" rel="stylesheet">
  13.     <style>
  14.       body {
  15.         padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
  16.       }
  17.     </style>
  18.     <link href="/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
  19.  
  20.     <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
  21.     <!--[if lt IE 9]>
  22.       <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
  23.     <![endif]-->
  24.   </head>
  25.  
  26.   <body>
  27.     <div class="container">
  28.         <div class="row">
  29.             <div class="span12" style="text-align:center; margin: 0 auto;">
  30.                 <form class="form-horizontal" method="post" action="/form/">
  31.                     <fieldset>
  32.                         <legend>Please login</legend>
  33.                         <div class="control-group">
  34.                             <label class="control-label" for="id_username">Username</label>
  35.                             <div class="controls">
  36.                                 <input name="username" maxlength="100" placeholder="Enter your username..." type="text" class="input-large" id="id_username" />
  37.                             </div>
  38.                         </div>
  39.                         <div class="control-group">
  40.                             <label class="control-label" for="id_password">Password</label>
  41.                             <div class="controls">
  42.                                 <input name="password" maxlength="100" placeholder="Enter your password..." type="password" class="input-large" id="id_password" />
  43.                             </div>
  44.                         </div>
  45.                     </fieldset>
  46.                 </form>
  47.             </div>
  48.         </div>
  49.     </div>
  50.  
  51.     <!-- Le javascript
  52.     ================================================== -->
  53.     <!-- Placed at the end of the document so the pages load faster -->
  54.     <script src="/bootstrap/js/jquery.js"></script>
  55.     <script src="/bootstrap/js/bootstrap-transition.js"></script>
  56.     <script src="/bootstrap/js/bootstrap-alert.js"></script>
  57.     <script src="/bootstrap/js/bootstrap-modal.js"></script>
  58.   </body>
  59. </html>
  60.        
  61. <div class="container">
  62.     <div class="row">
  63.         <div class="span12">
  64.             <form class="form-horizontal" method="post" action="/form/">
  65.                 <fieldset>
  66.                     <legend>Please login</legend>
  67.                     <div class="control-group">
  68.                         <label class="control-label" for="id_username">Username</label>
  69.                         <div class="controls">
  70.                             <input name="username" maxlength="100" placeholder="Enter your username..." type="text" class="input-large" id="id_username" />
  71.                         </div>
  72.                     </div>
  73.                     <div class="control-group">
  74.                         <label class="control-label" for="id_password">Password</label>
  75.                         <div class="controls">
  76.                             <input name="password" maxlength="100" placeholder="Enter your password..." type="password" class="input-large" id="id_password" />
  77.                         </div>
  78.                     </div>
  79.                 </fieldset>
  80.             </form>
  81.         </div>
  82.     </div>
  83. </div>
clone this paste RAW Paste Data