Image shape Bootstrap4

First, rounded picture

.rounded class lets picture shows the rounded corners:

<img src="cinqueterre.jpg" class="rounded" alt="Cinque Terre">

try it"

image


Second, oval picture

.rounded-circle may be provided based elliptical image:

<img src="cinqueterre.jpg" class="rounded-circle" alt="Cinque Terre">

try it"

image


Third, the thumbnail

.img-thumbnail class is used to set the thumbnail picture (picture with border):

<img src="cinqueterre.jpg" class="img-thumbnail" alt="Cinque Terre">

try it"

image


Fourth, the alignment of the image

Use .float-right class to set the image right-aligned, using .float-left Left Picture category:

<img src="paris.jpg" class="float-left">
<img src="cinqueterre.jpg" class="float-right">

尝试一下 »

image


五、响应式图片

图像有各种各样的尺寸,我们需要根据屏幕的大小自动适应。

我们可以通过在 <img> 标签中添加 .img-fluid 类来设置响应式图片。

.img-fluid 类设置了 max-width: 100%; 、 height: auto; :

<img class="img-fluid" src="img_chania.jpg" alt="Chania">

尝试一下 »

image

六、超大屏幕Jumbotron

Jumbotron(超大屏幕)会创建一个大的灰色背景框,里面可以设置一些特殊的内容和信息。

提示: Jumbotron 里头可以放一些 HTML标签,也可以是 Bootstrap 的元素。

我们可以通过在 <div> 元素 中添加 .jumbotron 类来创建 jumbotron:

<div class="jumbotron"> <h1>菜鸟教程</h1> <p>学的不仅是技术,更是梦想!!!</p> </div>

全屏幕的 Jumbotron

如果你想创建一个没有圆角的全屏幕,可以在 .jumbotron-fluid 类里头的 div添加 .container 或 .container-fluid 类来实现:

< Div class = "the Jumbotron the Jumbotron-Fluid " > 
  < div class = " Container " > 
      < h1 > rookie Tutorial </ h1 >  
      < the p- > learn not only technical, but also dream! ! ! </ P > 
  </ div > 
</ div >
image

Guess you like

Origin www.cnblogs.com/springsnow/p/12126395.html