Bootstrap-images of global css styles,

Source: Internet
Author: User

Bootstrap-images of global css styles,

I haven't updated my blog for a long time. I would like to share with you the little fun of life. As a programmer, It is very uncomfortable to work on computers all day long. Overtime is also common, so continuous work is not good for the body, and with the increase of age, the programmer's health will be getting worse and worse, or we suggest you exercise regularly, stretch the lower cervical spine and shoulder, when you go, you will find it great

(1) images

In Bootstrap version 3, add.img-responsiveClass allows images to support responsive layout. The essence is to set the imagemax-width: 100%;,height: auto;Anddisplay: block;So that the image can be scaled in its parent element.

If you want to use.img-responsiveClass image horizontal center, please use.center-blockClass, do not use.text-center.

SVG images and IE 8-10

In Internet Explorer 8-10, set.img-responsiveThe SVG image is not balanced. To solve this problem, addwidth: 100% \9;You can. Bootstrap does not automatically set this attribute for all image elements, as this will lead to confusion in other image formats.

The method is as follows:

Image shape

PassAdd the following classes to the element to make the image show different shapes.

Cross-browser compatibility 

Keep in mind that Internet Explorer 8 does not support the rounded corner attribute in CSS3.

Here, img-rounded is a rectangular display image, img-circle is a circular display image, and img-thumbnail is also a rectangular display image, but there is a gap between the four sides and the border.
Note: 1. Generally, image shape classes are used together with adaptive classes.
2. on the same website, the two images have the same display effect. The pixels of the images must be the same or the differences must not be too large. Otherwise, self-adaptation is used, you will find a lot worse.
3. Place the image under the raster system attribute class and you will find that there is a gap between the left and right sides of the image. Then you need to modify its css attribute because it has a gap between the left and right by default.
The image is here, and I hope it will help you.

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.