Bootstarp Learning (5) image, bootstarp learning image

Source: Internet
Author: User

Bootstarp Learning (5) image, bootstarp learning image
Image

Images are also frequently used in Webpage creation. The Bootstrap framework provides the following styles for image styles:

1. img-responsive:Response images, mainly for responsive design
2. img-rounded:Rounded corner Image
3. img-circle:Circular Image
4. img-thumbnail:Thumbnail slices

Usage:

The usage is very simple, you only needAdd the corresponding class name on the tag, as shown in the following code:

 

The running effect is as follows or the result window on the right is displayed:

For the source code corresponding to each state, you can view the 306th lines of the bootstrap.css file ~ Row 3:

img {vertical-align: middle;}.img-responsive,.thumbnail>img,.thumbnail a >img,.carousel-inner > .item >img,.carousel-inner > .item > a >img {display: block;max-width: 100%;height: auto;}.img-rounded {border-radius: 6px;}.img-thumbnail {display: inline-block;max-width: 100%;height: auto;padding: 4px;line-height: 1.42857143;background-color: #fff;border: 1px solid #ddd;border-radius: 4px;  -webkit-transition: all .2s ease-in-out;transition: all .2s ease-in-out;}.img-circle {border-radius: 50%;}

Set the image size:

Because the style does not limit the size of the image, you need to process the image size in other ways. For example, you can control the image container size. (Note that you cannot directly modify the size of the img image through the css style, so the operation will not respond)

Note:

For rounded and circular images, the CSS 3 rounded corner style is used. Therefore, IE8 and earlier versions are not supported, and there is no rounded corner effect.

The Bootstrap framework also isolates the image styles to better maintain the image styles:
1. For the LESS version, see scaffolding. less.
2. For the Sass version, see _ scaffolding. scss.
You can modify one of them and re-compile them to get the desired image style effect.

 

<Div class = "container"> <div class = "row"> <div class = "col-sm-4">  <div> default picture </div> <div class = "col-sm-4">  <div> rounded corner image </div> <div class =" col-sm-4 ">  <div> circular image </div> <div class = "row"> <div class = "col-sm-6">  <div> thumbnail </div> <div class =" col-sm-6 ">  <div> responsive image </div>> </div>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.