How to achieve rounded corners in bootstrap

藏色散人
Release: 2020-11-30 17:29:07
Original
6204 people have browsed it

How to implement rounded corners in bootstrap: first open the corresponding code file; then change the class style "avatar "Just add it directly to the class.

How to achieve rounded corners in bootstrap

Recommendation: "bootstrap tutorial"

The operating environment of this tutorial: Windows 10 system, bootstrap version 3.0, the The method is applicable to all brands of computers.

Bootstrap implements rounded corners, circular avatars and responsive images

Bootstrap provides four styles for the How to achieve rounded corners in bootstrap class, which are:

  • .img-rounded: rounded corners (not supported by IE8), add border-radius:6px to get image rounded corners;

  • .img- circle: circle (not supported by IE8), add border-radius:50% to make the entire image circular.

  • .img-thumbnail: Thumbnail function, add some padding and a gray border.

  • .img-responsive: Image responsive (will scale well to parent elements).

Use:

Just add the class style directly to class:

<img class="img-circle" src="img.jpg" alt="头像"/>
Copy after login

The effect is as follows:

How to achieve rounded corners in bootstrap

You can see the effects obtained by using various styles from the picture. It is very simple and convenient to process the picture. Sometimes according to needs, for example, when we need to use a circular avatar with inner margins and gray borders, we can superimpose the two styles of circle and thumbnail. The effect is as shown in the circle thumbnail picture above.

img-responsive Makes our images responsive. The so-called responsiveness means that it changes as a certain element changes, thereby achieving an adaptive effect.

The codes for the responsive two pictures in the above picture are as follows:

<figure   style="max-width:90%"> 
  <figcaption>responsive(150*150)</figcaption> 
  <img class="img-responsive " src="img.jpg" alt="头像"/> 
 </figure> 
<figure style="width: 100px;height: 100px;"> 
  <figcaption>responsive(100*100)</figcaption> 
  <img class="img-responsive " src="img.jpg" alt="头像"/> 
 </figure>
Copy after login

Here we do not set the size of the picture, but set the size of the element that wraps it, regardless of whether the figure is 150px*150px Or 100px*100px, the picture can be well extended to the parent element figure.

The above is the detailed content of How to achieve rounded corners in bootstrap. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!