Wednesday, August 27, 2014

Bootstrap CSS

Supported Form Controls

input, textarea, checkbox, radio, and select

input

Bootstrap offers support for all native HTML5 input types:
text, password, datetime, datetime-local, date, month, time, week, number, email, URL, search, tel, and color

<input type="text" placeholder="Text input">
<textarea rows="3"></textarea>




Buttons


Button sizes

If you need larger or smaller buttons, simply add classes .btn-large, .btn-small, or .btnmini to links or buttons

<p>
<button class="btn btn-mini btn-primary" type="button">Mini button</button>
<button class="btn btn-mini" type="button">Mini button</button>
</p>


If you want to create buttons that display like a block-level element, simply add the .btnblock class
These buttons will display at 100% width

<button class="btn btn-large btn-block btn-primary" type="button">Block level button</button>

Disabled Button Styling

For anchor elements, simply add the class of .disabled to the tag and the link will fade in color, and lose the gradient

<a href="#" class="btn btn-large btn-primary disabled">Primary link</a>
<a href="#" class="btn btn-large disabled">Link</a>

You will need to use some JavaScript to actually disable the link

For a button, simply add the disabled attribute to the button, so JavaScript is not directly needed.

<button type="button" class="btn btn-large btn-primary disabled" disabled="disabled">Primary button</button>
<button type="button" class="btn btn-large" disabled>Button</button>

Images

<img src="..." class="img-rounded">
<img src="..." class="img-circle">
<img src="..." class="img-polaroid">

Icons

Bootstrap bundles 140 icons into one sprite that can be used with buttons, links, navigation, and form fields
The icons are provided by GLYPHICONS

Button groups
<div class="btn-group">
  <button type="button" class="btn btn-default">
<span class="glyphicon glyphicon-star"></span> Star
  </button>
  <button type="button" class="btn btn-default">
<span class="glyphicon glyphicon-heart"></span> Heart
  </button>
  <button type="button" class="btn btn-default">Right</button>
</div>

Navigation

<ul class="nav nav-list">
<li class="active">
<a href="#">
<span class="glyphicon glyphicon-home"></span> Home
</a>
</li>
<li>
<a href="#">
<span class="glyphicon glyphicon-heart"></span> Heart
</a>
</li>
</ul>


No comments:

Post a Comment