Image shapes
- Rounded corners
- Circle
- Thumbnail
Rounded Corners
- Rounded corners are used for Rounded corners of an image.
- .img-roundedclass adds Rounded corners to an image.
- Rounded corners are not supported in IE8.
- The image corners will be rounded to display the images.
Sample program for Rounded Corners
- <!DOCTYPE html>
- <html>
- <head>
- <title>Button size</title>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial scale=1">
- <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"> </head>
- <body>
- <div class="text-center img1"> <img src="one.png" class="img-rounded" width="304" height="304"> </div>
- <script type="text/javascript" src="js/bootstrap.min.js"></script>
- <script type="text/css" src="js/jquery"></script>
- </body>
- </html>
Output

- The image given above corners will be rounded shape i.e. Rounded Corners.
Circle
- Circle is used for circle shape of an image.
- .img-circleclass shaped the image to a Circle.
- Rounded corners will not to be supported in IE8.
- The image corners will be Circle in shape.
Sample program for Circle
- <!DOCTYPE html>
- <html>
- <head>
- <title>Button size</title>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial scale=1">
- <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"> </head>
- <body>
- <div class="text-center img1"> <img src="one.png" class="img-circle" width="300" height="300"> </div>
- <script type="text/javascript" src="js/bootstrap.min.js"></script>
- <script type="text/css" src="js/jquery"></script>
- </body>
- </html>
Output

- The image given above will be shaped for Circle.
Thumbnail
- The thumbnail is used to create default border of an image. It should be in Rounded Corners
- .img- thumbnailclass shaped the image to create default border of an image. It should be in rounded corners
Sample program for Thumbnail
- <!DOCTYPE html>
- <html>
- <head>
- <title>Button size</title>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial scale=1">
- <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"> </head>
- <body background="black">
- <div class="text-center img1"> <img src="one.png" class="img-thumbnail" width="304" height="304"></div>
- <script type="text/javascript" src="js/bootstrap.min.js"></script>
- <script type="text/css" src="js/jquery"></script>
- </body>
- </html>
Output

Responsive images
- The image will come under all sizes.
- Responsive images automatically adjust to fit the size of the screen.
- You can create a responsive image by adding .img-responsive.
- That class will be added in <img>tag.
- The image will automatically respond to the parent element.
- Automatically the .img-responsive class will apply the display:block, max-width:100% and height:auto; to the image.
Sample program for Responsive Images
- <!DOCTYPE html>
- <html>
- <head>
- <title>Button size</title>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial scale=1">
- <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"> </head>
- <body background="black">
- <div class="text-center img1"> <img class="img-responsive" src="one.png">
- <script type="text/javascript" src="js/bootstrap.min.js"></script>
- <script type="text/css" src="js/jquery"></script>
- </body>
- </html>
Output
- The program given above will be created to responsive images in the parent element.
- Resize the Browser Window to see the effect.
Image Gallery
- You can also use Bootstrap's grid system in conjunction with the .thumbnail class to create an Image Gallery.
- We can see the one picture, which is having the link. We can click the link and the gallery will open.
Sample program for an Image Gallery
- <!DOCTYPE html>
- <html>
- <head>
- <title>Button size</title>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial scale=1">
- <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"> </head>
- <body background="black">
- <div class="row">
- <div class="col-md-4">
- <div class="thumbnail"> <a href="one.png">
- <img src="two.jpg" alt="Lights" style="width:100%">
- <div class="caption">
- <p>Open gallery</p>
- </div>
- </a> </div>
- </div>
- <script type="text/javascript" src="js/bootstrap.min.js"></script>
- <script type="text/css" src="js/jquery"></script>
- </body>
- </html>
Output 1

- Now, we can click Open gallery link and the gallery will open.
- Now, we can see after clicking Open gallery, the gallery will open.
Output 2

- The image will be open (we can store lots of images in the gallery).
Responsive Embeds
- Videos or slideshows scale properly on any device.
- Classes can be applied directly to <iframe>, <embed>, <video>, and <object> elements.
- containing <div> defines the aspect ratio of the video.
What is an aspect ratio?
- Image describes the proportional relationship between its width and height.
- Two common video aspect ratio are 4:3 and 16:9.
- The 4:3 is used in universal video format of the 20th century.
- The 16:9 universal is for HD television and digital television.
Sample programming for Responsive Embeds (aspect ratio)
- <!DOCTYPE html>
- <html>
- <head>
- <title>Button size</title>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial scale=1">
- <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"> </head>
- <!-- 16:9 aspect ratio -->
- <div class="embed-responsive embed-responsive-16by9"> <iframe class="embed-responsive-item" src="..."></iframe> </div>
- <!-- 4:3 aspect ratio -->
- <div class="embed-responsive embed-responsive-4by3"> <iframe class="embed-responsive-item" src="..."></iframe> </div>
- <script type="text/javascript" src="js/bootstrap.min.js"></script>
- <script type="text/css" src="js/jquery"></script>
- </body>
- </html>
Bootstrap Grid Offset
What is Bootstrap offset?
- We have Bootstrap grid system two containers, where the first container is having two columns (to be divided into 3 and 3 columns (3+3=6)) and the second container is having four columns(3+3+3+3=12).
Sample program
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial scale=1">
- <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
- <link rel="stylesheet" type="text/css" href="css/offset.css"> </head>
- <body bgcolor="pink">
- <div class="container">
- <div class="row">
- <div class="col-md-3">
- <div class="customDiv">column 1</div>
- </div>
- <div class="col-md-3">
- <div class="customDiv">column 2</div>
- </div>
- </div>
- </div>
- <div class="container">
- <div class="row">
- <div class="col-md-3">
- <div class="customDiv">column 1</div>
- </div>
- <div class="col-md-3">
- <div class="customDiv">column 2</div>
- </div>
- <div class="col-md-3">
- <div class="customDiv">column 3</div>
- </div>
- <div class="col-md-3">
- <div class="customDiv">column 4</div>
- </div>
- </div>
- </div>
- <script type="text/javascript" src="js/bootstrap.min.js"></script>
- <script type="text/css" src="js/jquery"></script>
- </body>
- </html>







Former memberPosted Jun 15, 2017, 10:16 AM
This article has lack of explanation. it seems the person who knows bootstrap he just copy code here. see this code <div class="col-md-3 col-md-offset-3 "> <div class="customDiv">column 1</div> </div> you did not bother what col-md-offset-3 does and add in code for which two come center. if i feel col-md-offset-3 just add some mergin then how it can add mergin at left and right side of two columns?
Gayathri AnbazhaganPosted Jun 5, 2017, 11:39 AM
Nice article....thanks for sharing