详解Bootstrap四种图片样式_李大同
加入收藏 |
设为首页 |
会员中心 | 我要投稿
|
李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
详解Bootstrap四种图片样式
发布时间:2020-12-18 00:57:56 所属栏目:安全 来源:网络整理
导读:在本章中,我们将学习 Bootstrap 对图片的支持。Bootstrap 提供了四个可对图片应用简单样式的class,分别是: img-rounded 添加 border-radius:6px 来获得图片圆角img-circle 添加 border-radius:50% 来让整个图片变成圆形img-thumbnail 添加一些内边距(pad
在本章中,我们将学习 Bootstrap 对图片的支持。Bootstrap 提供了四个可对图片应用简单样式的class,分别是:
img-rounded 添加 border-radius:6px 来获得图片圆角
img-circle 添加 border-radius:50% 来让整个图片变成圆形
img-thumbnail 添加一些内边距(padding)和一个灰色的边框
img-responsive 图片响应式
BootstrapDemo
.img-rounded{border-radius:6px;}
效果:
2、img-circle
|
.img-circle{border-radius:50%;}
效果(因为本图片的宽高大小不同,所以呈现出椭圆,如果将width和height设置相同,那么会呈现出一个圆):
3、img-thumbnail
.img-thumbnail{display:inline-block;max-width:100%;height:auto;padding:4px;line-height:1.42857143;
background-color:#FFF;border:1px solid #DDD;border-radius:4px;transition:all 0.2s ease-in-out;}
效果:
4、img-responsize
.img-responsive{display:block;max-width:100%;height:auto;}
效果(img中的width属性值被忽略):
以上内容分步骤给大家介绍了Bootstrap四种图片样式的相关知识,希望大家喜欢。
(编辑:李大同)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!