HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Rounded Corners
Rounded Corners:
Circle:
Thumbnail:
The .img-rounded
class adds rounded corners to an image (IE8 does
not support rounded corners):
<img src="cinqueterre.jpg" class="img-rounded" alt="Cinque Terre">
The .img-circle
class shapes the image to a circle (IE8 does not
support rounded corners):
<img src="cinqueterre.jpg" class="img-circle" alt="Cinque
Terre">
The .img-thumbnail
class shapes the image to a thumbnail:
<img src="cinqueterre.jpg" class="img-thumbnail" alt="Cinque Terre">
Images come in all sizes. So do screens. Responsive images automatically adjust to fit the size of the screen.
Create responsive images by adding an .img-responsive
class
to the <img>
tag. The image will then scale nicely to the parent element.
The .img-responsive
class applies display: block;
and max-width: 100%;
and
height: auto;
to the image:
<img class="img-responsive" src="img_chania.jpg" alt="Chania">
You can also use Bootstrap's grid system in conjunction with the .thumbnail
class
to create an image gallery.
Also let videos or slideshows scale properly on any device.
Classes can be applied directly to <iframe>, <embed>, <video>, and <object> elements.
The following example creates a responsive video by adding an .embed-responsive-item
class
to an <iframe>
tag (the video will then scale nicely to the parent element).
The containing <div>
defines the aspect ratio of the video:
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" src="..."></iframe>
</div>
What is aspect ratio?
The aspect ratio of an image
describes the proportional relationship between its width and its height. Two common video aspect ratios are 4:3
(the universal video format of the 20th
century), and 16:9 (universal for HD television and European digital
television).
You can choose between two aspect ratio classes:
<!-- 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>
Use a Bootstrap class to shape the image as a circle.
<img src="img_chania.jpg" alt="Chania" class="">
For a complete reference of all image classes, go to our complete Bootstrap Image Reference.