Writing Bootstrap 2 syntax, using Bootstrap 3 styles.
Some system has written in Bootstrap2 (example: Joomla CMS), but when Bootstrap3 release, it's not backward compatible. This adapter can help developer working in Bootstrap 2 & 3 syntax that will not break their system when migrating to version 3, or make Bootstrap 2 system be flatten styles.
A html page written in Bootstrap 2 will be:
<!-- Bootstrap 2 css -->
<link href="assets/css/bootstrap.css" rel="stylesheet">
<link href="assets/css/bootstrap-responsive.css" rel="stylesheet">
Then we remove Bootstrap 2 css and add Bootstrap 3 css:
<!-- Bootstrap 3 css -->
<link href="assets/css/bootstrap.css" rel="stylesheet">
Download and uncompress adapter zip file, we will get a file bootstrap3-adapter.min.css
.
Add it after bootstrap css:
<!-- Bootstrap 3 css -->
<link href="assets/css/bootstrap.css" rel="stylesheet">
<link href="assets/css/bootstrap3-adapter.min.css" rel="stylesheet">
Now, a website written in Bootstrap 2 will be Bootstrap 3 flatten styles.
Add classes to an <img>
element to easily style images in any project.
<img src="..." class="img-rounded"> <img src="..." class="img-circle"> <img src="..." class="img-polaroid">
Heads up! .img-rounded
and .img-circle
do not work in IE7-8 due to lack of border-radius
support.
Labels | Markup |
---|---|
Default |
<span class="label">Default</span>
|
Success |
<span class="label label-success">Success</span>
|
Warning |
<span class="label label-warning">Warning</span>
|
Important |
<span class="label label-important">Important</span>
|
Info |
<span class="label label-info">Info</span>
|
Inverse |
<span class="label label-inverse">Inverse</span>
|
Name | Example | Markup |
---|---|---|
Default | 1 |
<span class="badge">1</span>
|
Success | 2 |
<span class="badge badge-success">2</span>
|
Warning | 4 |
<span class="badge badge-warning">4</span>
|
Important | 6 |
<span class="badge badge-important">6</span>
|
Info | 8 |
<span class="badge badge-info">8</span>
|
Inverse | 10 |
<span class="badge badge-inverse">10</span>
|
For easy implementation, labels and badges will simply collapse (via CSS's :empty
selector) when no content exists within.