Bootstrap Code Samples
Twitter Bootstrap makes life easy. If you are not much into designing layouts from pure CSS, twitter-bootstrap is ideal for you. Following shows some code samples that you might often need. Setting up bootstrap is trivial.
Setting-Up
- Download Bootstrap from http://getbootstrap.com/
- Unzip the folder. You may find following folders in it.
- Include these three folders in your Project folder.
- Add link to your index.html to bootstrap.css within in <head> tag as follows
<link rel="stylesheet" type="text/css" href="css/bootstrap.css"/>
- Add bootstrap script tags just above the </body> tag. Make sure you have jquery.js file
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/bootstrap.js"></script>
- That's it. To check if you have properly setup bootstrap, Write this line of code within the body section
<button class="btn btn-success">Test</button>
- Open up index.html in a browser. You should see green color Test button on the screen.
Nav-Bar Sample
Carousel Sample
Grid-System Sample
Setting-Up
- Download Bootstrap from http://getbootstrap.com/
- Unzip the folder. You may find following folders in it.
- Include these three folders in your Project folder.
- Add link to your index.html to bootstrap.css within in <head> tag as follows
<link rel="stylesheet" type="text/css" href="css/bootstrap.css"/>
- Add bootstrap script tags just above the </body> tag. Make sure you have jquery.js file
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/bootstrap.js"></script>
- That's it. To check if you have properly setup bootstrap, Write this line of code within the body section
<button class="btn btn-success">Test</button>
- Open up index.html in a browser. You should see green color Test button on the screen.
Nav-Bar Sample
Carousel Sample
Grid-System Sample
This comment has been removed by the author.
ReplyDelete