Bootstrap5 图像形状

圆角图片.rounded

<div class="container mt-3">
  <h2>圆角图片</h2>
  <p>.rounded 类可以让图片显示圆角效果:</p>            
  <img src="http://static.runoob.com/images/mix/cinqueterre.jpg" class="rounded" alt="Cinque Terre" width="304" height="236"> 
</div>
Cinque Terre

椭圆图片.round-circle

<img src="http://static.runoob.com/images/mix/cinqueterre.jpg" class="rounded-circle" alt="Cinque Terre">

缩略图.img-thumbnail⭐

<img src="a.jpg" class="img-thumbnail" alt="Cinque Terre" width="304" height="236">

图片对齐方式.folat-start

<div class="container mt-3">
  <h2>图片对齐方式</h2>
  <p>使用 .float-start 类来设置图片左对齐,使用 .float-end 类设置图片右对齐:</p>
  <img src="paris.jpg" class="float-start" alt="Paris" width="304" height="236"> 
  <img src="paris.jpg" class="float-end" alt="Paris" width="304" height="236"> 
</div>

图片居中.mx-auto d-block

<div class="container mt-3">
  <h2>图片居中</h2>
  <p>使用 .mx-auto (margin:auto) 和 .d-block (display:block) 类来设置图片居中对齐:</p> 
  <img src="paris.jpg" class="mx-auto d-block" style="width:50%"> 
</div>

响应式图片.img-fluid

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

<div class="container mt-3">
  <h2>响应式图片</h2>
  <p>.img-fluid 类可以设置响应式图片,重置浏览器大小查看效果:</p>
  <img src="http://static.runoob.com/images/mix/paris.jpg" class="img-fluid">
</div>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Gary jie

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值