Bootstrap facilates four features to stylize images and these are .img-rounded, .img-circle, .img-thumbnail and the last one is .img-resposvie.
The major use of image properties of Bootstrap are :
- To add rounded corners to an image.
- To shape the images into a circle.
- To make the image change into a thumbnail.
Example:
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8"/>
<title>nirajanghimirey's workshop</title>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css"/>
</head>
<body>
<div class="container">
<h1>Example of Image</h1>
<div class="row">
<div class="col-sm-4 col-md-4">
<img src="images/image.jpg" class="img-rounded" alt="Image" width="320" height="240"/>
<span>Rounded</span>
</div>
<div class="col-sm-4 col-md-4">
<img src="images/image.jpg" class="img-circle" alt="Image" width="320" height="240"/>
<br><span>Circle</span>
</div>
<div class="col-sm-4 col-md-4">
<img src="images/image.jpg" class="img-thumbnail" alt="Image" width="320" height="240"/>
<span>Thumbnail</span>
</div>
</div>
<div class="row">
<div class="col-sm-4 col-md-4">
<img src="images/image.jpg" class="img-responsive" alt="Image" width="320" height="240"/>
<span>Responsive</span>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
</body>
</html>
No comments:
Post a Comment