Bootstrap学习(3)_html/css_WEB-ITnose
Bootstrap 图片
Bootstrap 对图片的支持。Bootstrap 提供了三个可对图片应用简单样式的 class:
请看下面的实例演示:
<!DOCTYPE html><html><head> <title>Bootstrap 实例 - 图像</title> <link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet"> <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script> <script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script></head><body><img class="img-rounded lazy" src="/static/imghw/default1.png" data-src="/wp-content/uploads/2014/06/download.png" alt="Bootstrap学习(3)_html/css_WEB-ITnose" ><img class="img-circle lazy" src="/static/imghw/default1.png" data-src="/wp-content/uploads/2014/06/download.png" alt="Bootstrap学习(3)_html/css_WEB-ITnose" ><img class="img-thumbnail lazy" src="/static/imghw/default1.png" data-src="/wp-content/uploads/2014/06/download.png" alt="Bootstrap学习(3)_html/css_WEB-ITnose" ></body></html>
显示结果如下:
类
以下类可用于任何图片中。
.img-rounded | 为图片添加圆角 (IE8 不支持) |
.img-circle | 将图片变为圆形 (IE8 不支持) |
.img-thumbnail | 缩略图功能 |
.img-responsive | 图片响应式 (将很好地扩展到父元素) |
圆角的图片
<!DOCTYPE html><html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://apps.bdimg.com/libs/bootstrap/3.3.0/css/bootstrap.min.css"> </head> <body style = "background-color:black"> <div style = "color:white"> <h2 id="图片">图片</h2> <p> .img-rounded 类为图片添加圆角 (IE8 不支持):</p> <img class="img-rounded lazy" src="/static/imghw/default1.png" data-src="1.jpg" alt="Cinque Terre" style="max-width:90%" style="max-width:90%"> </div> <script src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script> <script src="http://apps.bdimg.com/libs/bootstrap/3.3.0/js/bootstrap.min.js"></script> </body></html>
效果如下图所示:
圆形的图片
<!DOCTYPE html><html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://apps.bdimg.com/libs/bootstrap/3.3.0/css/bootstrap.min.css"> </head> <body style = "background-color:black"> <div class="container" style = "color:white"> <h2 id="图片">图片</h2> <p> .img-rounded 类为图片添加圆角 (IE8 不支持):</p> <img class="img-circle lazy" src="/static/imghw/default1.png" data-src="1.jpg" alt="Cinque Terre" style="max-width:90%" style="max-width:90%"> </div> <script src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script> <script src="http://apps.bdimg.com/libs/bootstrap/3.3.0/js/bootstrap.min.js"></script> </body></html>
效果如下图所示
缩略图
<!DOCTYPE html><html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://apps.bdimg.com/libs/bootstrap/3.3.0/css/bootstrap.min.css"> </head> <body style = "background-color:black"> <div class="container" style = "color:white"> <h2 id="图片">图片</h2> <p> .img-thumbnail 类可制作图片缩略图:</p> <img class="img-thumbnail lazy" src="/static/imghw/default1.png" data-src="1.jpg" alt="Cinque Terre" style="max-width:90%" style="max-width:90%"> </div> <script src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script> <script src="http://apps.bdimg.com/libs/bootstrap/3.3.0/js/bootstrap.min.js"></script> </body></html>
效果如下图所示:
响应式图片
通过在 标签添加 .img-responsive 类来让图片支持响应式设计。 图片将很好地扩展到父元素。
.img-responsive 类将 max-width: 100%; 和 height: auto; 样式应用在图片上:
<!DOCTYPE html><html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://apps.bdimg.com/libs/bootstrap/3.3.0/css/bootstrap.min.css"> </head> <body style = "background-color:black"> <div style = "color:white"> <h2 id="图片">图片</h2> <p> .img-thumbnail 类可制作图片缩略图:</p> <img class="img-responsive lazy" src="/static/imghw/default1.png" data-src="1.jpg" alt="Cinque Terre" style="max-width:90%" style="max-width:90%"> </div> <script src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script> <script src="http://apps.bdimg.com/libs/bootstrap/3.3.0/js/bootstrap.min.js"></script> </body></html>
效果如下图所示
Bootstrap学习(1):
Bootstrap学习(2):
致谢:感谢您的阅读!

热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

记事本++7.3.1
好用且免费的代码编辑器

SublimeText3汉化版
中文版,非常好用

禅工作室 13.0.1
功能强大的PHP集成开发环境

Dreamweaver CS6
视觉化网页开发工具

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)

公众号网页更新缓存,这玩意儿,说简单也简单,说复杂也够你喝一壶的。你辛辛苦苦更新了公众号文章,结果用户打开还是老版本,这滋味,谁受得了?这篇文章,咱就来扒一扒这背后的弯弯绕绕,以及如何优雅地解决这个问题。读完之后,你就能轻松应对各种缓存难题,让你的用户始终体验到最新鲜的内容。先说点基础的。网页缓存,说白了就是浏览器或者服务器为了提高访问速度,把一些静态资源(比如图片、CSS、JS)或者页面内容存储起来。下次访问时,直接从缓存里取,不用再重新下载,速度自然快。但这玩意儿,也是个双刃剑。新版本上线,

本文讨论了使用HTML5表单验证属性,例如必需的,图案,最小,最大和长度限制,以直接在浏览器中验证用户输入。

本文展示了使用CSS为网页中添加有效的PNG边框。 它认为,与JavaScript或库相比,CSS提供了出色的性能,详细介绍了如何调整边界宽度,样式和颜色以获得微妙或突出的效果

本文讨论了html&lt; datalist&gt;元素,通过提供自动完整建议,改善用户体验并减少错误来增强表格。Character计数:159

本文讨论了HTML&lt; meter&gt;元素,用于在一个范围内显示标量或分数值及其在Web开发中的常见应用。它区分了&lt; meter&gt;从&lt; progress&gt;和前

本文解释了HTML5&lt; time&gt;语义日期/时间表示的元素。 它强调了DateTime属性对机器可读性(ISO 8601格式)的重要性,并在人类可读文本旁边,增强Accessibilit

本文讨论了HTML&lt; Progress&gt;元素,其目的,样式和与&lt; meter&gt;元素。主要重点是使用&lt; progress&gt;为了完成任务和LT;仪表&gt;对于stati
