Bootstrap中实现图片圆角效果

Bootstrap 对图片的支持。Bootstrap 提供了三个可对图片应用简单样式的 class:

.img-rounded:添加 border-radius:6px 来获得图片圆角。
.img-circle:添加 border-radius:500px 来让整个图片变成圆形。
.img-thumbnail:添加一些内边距(padding)和一个灰色的边框。
请看下面的实例演示:

  1. <!DOCTYPE html>  
  2. <html>  
  3. <head>  
  4.    <title>Bootstrap 实例 - 图像</title>  
  5.    <link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">  
  6.    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>  
  7.    <script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>  
  8. </head>  
  9. <body>  
  10.   
  11. <img src="/wp-content/uploads/2014/06/download.png"   
  12.    class="img-rounded">  
  13. <img src="/wp-content/uploads/2014/06/download.png"   
  14.    class="img-circle">  
  15. <img src="/wp-content/uploads/2014/06/download.png"   
  16.    class="img-thumbnail">  
  17. </body>  
  18. </html>    

       

 显示结果如下:

<img> 类
以下类可用于任何图片中。
.img-rounded 为图片添加圆角 (IE8 不支持)
.img-circle 将图片变为圆形 (IE8 不支持)
.img-thumbnail 缩略图功能
.img-responsive 图片响应式 (将很好地扩展到父元素)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值