Bootstrap4 图像形状

Bootstrap4 教程 · 2019-03-01 23:26:28

圆角图片

.rounded 类可以让图片显示圆角效果:

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

椭圆图片

.rounded-circle 类可以设置椭圆形图片:

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

缩略图

.img-thumbnail 类用于设置图片缩略图(图片有边框):

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

图片对齐方式

使用 .float-right 类来设置图片右对齐,使用 .float-left 类设置图片左对齐:

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

响应式图片

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

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

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

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

点击查看所有 Bootstrap4 教程 文章: https://www.codercto.com/courses/l/26.html

查看所有标签

The Book of CSS3

The Book of CSS3

Peter Gasston / No Starch Press / 2011-5-13 / USD 34.95

CSS3 is the technology behind most of the eye-catching visuals on the Web today, but the official documentation can be dry and hard to follow. Luckily, The Book of CSS3 distills the heady technical la......一起来看看 《The Book of CSS3》 这本书的介绍吧!

URL 编码/解码
URL 编码/解码

URL 编码/解码

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具