9lessons programming blog
Loading Search
Wall Script
Monday, March 19, 2012

Bootstrap Tutorial for Blog Design.

Bootstrap is a toolkit, which is developed by the Twitter team. This actually helps you to develop web applications much faster.Bootstrap contains CSS and Javascript files using which you can enrich your web page with Grids, Layouts, Typography, Tables, Forms, Navigation, Alerts etc,. This avoids cross browser compatibility problem. This time I am aiming to explain how to design a template of the basic fluid blog for different resolutions and devices like iPad and iPhone.
.

Bootstrap Tutorial

Try live demo with different resolutions or resize your browser to check fluid adjustments.

Download Script     Live Demo

Download Twitter Bootstrap Project from https://github.com/twitter/bootstrap.

Bootstrap CSS
Just include two CSS file bootstrap.css and bootstrap-responsive.css. You can use github url too http://twitter.github.com/bootstrap/assets/css/bootstrap.css
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Page Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="assets/css/bootstrap.css" rel="stylesheet">
<link href="assets/css/bootstrap-responsive.css" rel="stylesheet">
</head>
<body>
// Webpage layout design.
</body>
</html>

Bootstrap JavaScript
Include the following JavaScript files and Place them at the end of the document.this will make the page load faster.
<script src="assets/js/jquery.js"></script>
<script src="assets/js/bootstrap-transition.js"></script>
<script src="assets/js/bootstrap-alert.js"></script>
<script src="assets/js/bootstrap-modal.js"></script>
<script src="assets/js/bootstrap-dropdown.js"></script>
<script src="assets/js/bootstrap-scrollspy.js"></script>
<script src="assets/js/bootstrap-tab.js"></script>
<script src="assets/js/bootstrap-tooltip.js"></script>
<script src="assets/js/bootstrap-popover.js"></script>
<script src="assets/js/bootstrap-button.js"></script>
<script src="assets/js/bootstrap-collapse.js"></script>
<script src="assets/js/bootstrap-carousel.js"></script>
<script src="assets/js/bootstrap-typeahead.js"></script>

Download bootstrap asserts Click Here

Grids
This is the Grid System using Twitter Bootstrap, it supports 940px wide 12 column Grids. The span1 class has a width of 40px.
Bootstrap Tutorial

Layout
The page container div is divided into two parts consisting of one main area span8 for articles and a sidebar span4 for other information. Here I have applied row-fluid class.This is for responsive design and multiple resolutions for devices.It makes auto re-sizing of the divs and images easily possible .
<div class="container">
<div class="row-fluid">
<div class="span8">
// Main Part
</div>
<div class="span4">
// Sidebar Part
</div>
</div>
</div>

The above code layout wireframe.
Bootstrap Blog Design Tutorial

Main Part
Here the articles feed list contains title, description and image. Here btn is the class of the read more button.
<div class="span8">
// Main Part
<div class="row">
// Articles Loop
<div class="span7">
<h2>Article Title.</h2>
<p>Article Description.</p>
<p><img src='ArticleImage.png' class="row-fluid"></p>
<p><a class="btn" href="#">Read More »</a></p>
</div>
</div>
// Articles Loop End
</div>
</div>

For different color buttons just apply below class names.
Bootstrap buttons

Sidebar
This block for author information, widgets, recent posts and other stuff.
<div class="span4 ">
// Sidebar Part
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li class="nav-header">About Me</li>
<li>Author Data</li>
<li class="nav-header">Recent Posts</li>
<li>link1</li>
<li>link1</li>
<li>link1</li>
<li class="nav-header">Advertisements</li>
<li>ad1</li>
<li>ad2</li>
</ul>
</div>


</div>

Navbar
Fixed top menu navigation bar.
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
// Iphone View Menu Button
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>


<a class="brand" href="#">9LESSONS.info</a>
<div class="nav-collapse">
<ul class="nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">Tutorials</a></li>
<li><a href="#">Demos</a></li>             
</ul>           
</div>


</div>
</div>

Normal view for high resolution.
Bootstrap buttons

Mobile view collapsed menus list.
Bootstrap buttons

Share this post

Comments
{ 48 comments }
Rakesh Sharma said...

A very nice post with great explanation. I Liked it.

Anonymous said...

thanks so much...

Anonymous said...

very nice man!!

Anonymous said...

AWESOME THANKS :)

Kathir said...

nice one Srinivas.. there was a problem in while viewing on ie6..

Anonymous said...

Great! Thank you very much

Virendra Rajput said...

Nice 1

d3v said...

Nice !

Anonymous said...

I study for a few days until want to give up to use then come up this great article to inspire me...Awesome Thanks:)

Anoop D S said...

nice........!

Anonymous said...

Yes i likei it

Anonymous said...

nice

Brayan Cru said...

Nice , ya lo conocia haces algunis meses este framework , gracias por le tutorial igualmente ;)

dedy-design said...

look nice.., will try:)

Raaz said...

on the nav bar can you please to create a drop down list? when i tried to make one it just break the design while loading with ipad.

doumé said...

Wonderful! Thanks for your great job!

Hrishikesh said...

Great job by the twitter guys. Thanks for sharing and letting use know about such an awesome work.

Anonymous said...

Thanks Srinivas nice article, you have covered almost everything briefly. I just share another resource seems good.
http://www.w3resource.com/twitter-bootstrap/tutorial.php

AMiN said...

awesome.

Amit sarwara said...

really informative post frnd...thanks a lot for sharing....

fuad indra said...

great post .....this blog is the best blog I see..

imaninside said...

again, i get more from you...thank you

Srinivas Tamada said...

Thank you all, next part application design using bootstrap.

BigD said...

I think this is the simplest bootstrap tutorial I found. Great. I like basic simplicity. But there is one detail missing. For the navbar to be fixed to the top without margin, and the body not to creep under the navbar, there needs to be a style definition or body with padding-top of 60px between the two bootstrap.css and bootstrap-responseve.css links.

Raj said...

Great! Thank you very much...awesome.

Sunil Pratap Singh said...

good .. I am not from hard core coding proffession but its my desire to learn coding as PHP .. oracle etc let see ...

ryscript said...

Thanks for sharing, this is totally great article, I will open view your site at any time.

jay said...

Hi how can we dynamically load content into the tabs?

MyGrahak said...

India is now the hub of Information Technology or IT. There has never been a time when India was seen as an industrial hub. It is due to the boom and bloom of Information Technology that India is gaining a foothold in the global markets. And this is a good thing because this will only increase giving India a position as a global leader. It feels proud to see so many technological inventions being made by Indians like you. Salute!

Divya Bhaskar
MyGrahak.com

جملة said...

great post ... thnx ^^

Anonymous said...

thnx...good post..Its really helpful...!!!

Faceook Application Developer said...

I am impressed by this awesome site to me, i am impressed by this unique and inspirational to me.

Obat Anti Rokok said...

awesome! its really helpful for me
thanks!

Anonymous said...

excellent

Chris said...

very well explained, thank you, could you possibly do a more indepth tute?

╚► Jareta ◄╗ said...

This ia not perfectly view in my browser sgs2.
here the ss http://imm.io/p9eX
but in landscape is workly good in portrait not good :-(

ekkarach said...

thanks for sharing, really helpful

sheetal verma said...

mast hai dude!!!!!!1

Anonymous said...

download bootstrap with docs from the official site. there is a basic file in the examples to get you started. hope this info helps

/P

Alexander Schmidt said...

Your tutorial is great! I write something similar and maybe someone find it helpfull, too:

Blank Template and Twitter Bootstrap Tutorial for Joomla!
http://blank.vc/blog.html/19-blank-template-and-twitter-bootstrap-tutorial-for-joomla.html

Thanks for sharing.

Anonymous said...

Thank You For The Great Tutorial

Shrikant said...

responsive is not working in Chrome

Anonymous said...

nice :)

Nagarjuna Immadi said...

we want more tutorial on bootstrap

Jake said...

We're working hard to make Bootstrap even easier to learn by automatically generating the HTML and CSS in a drag-and-drop interface builder called Divshot (http://divshot.com). Check it out!

Anonymous said...

nice...

Anonymous said...

Hi in demo page layout show not aligned!!!

rafiq islam said...

many many thanks...

Post a Comment