我试图让4个图像的所有行都具有相同的高度尺寸,我已经试过玩的宽度和高度使用CSS,但似乎没有任何工作,肖像图片最后总是比风景的人高,这里的代码:
这是发生的事情:
这就是我想要的(所有都有相同的高度)
1> Josh Rutherf..:您可以取消HTML中的宽度/高度属性,并使用CSS执行此操作.只需明确设置高度,宽度为
auto
.例如:.img-responsive { width: auto; height: 100px; }您需要小心,水平留出足够的空间,因为一旦缩放,您将不知道任何这些图像的确切宽度.
2> Steve K..:这是一种响应方式.
.img-wrapper { position: relative; padding-bottom: 100%; overflow: hidden; width: 100%; } .img-wrapper img { position: absolute; top:0; left:0; width:100%; height:100%; }您将需要使用img-wrapper的填充底部来使图像显示高度,如果您希望图像显示不是100%的col但是希望它们阻止,则可以移除宽度100%从包装器中添加显示块和您想要的自定义宽度,但这应该可行.
推荐阅读
如何解决《如何在Redux中将全局状态数据处理为深层嵌套组件?》经验,为你挑选了1个好方法。 ... [详细] 如何解决《内部MSBuild错误:已经注册了构建时间》经验,为你挑选了1个好方法。 ... [详细] 如何解决《在AsciiDoc中使用图像作为链接》经验,为你挑选了1个好方法。 ... [详细] 如何解决《Javascript数组函数有我无法看到的错误》经验,为你挑选了1个好方法。 ... [详细] 如何解决《如何将对象注入WCF的IErrorHandler?》经验,为你挑选了1个好方法。 ... [详细] 如何解决《AndroidStudio未与adbGLIBC通信.未找到错误》经验,为你挑选了1个好方法。 ... [详细] 如何解决《具有圆角的Android自定义WebView》经验,为你挑选了1个好方法。 ... [详细] 如何解决《何时使用SQLAlchemy.get()vs.filter(Foo.ID==primary_key_id).first()》经验,为你挑选了2个好方法。 ... [详细] 如何解决《对于特定用户MySQL,在同一个表中查找日期范围重叠》经验,为你挑选了0个好方法。 ... [详细] 如何解决《WatchKit应用程序提交失败;MinimumOSVersion》经验,为你挑选了1个好方法。 ... [详细] 如何解决《忽略jshint不必要的分号错误》经验,为你挑选了1个好方法。 ... [详细] 如何解决《在Laravel中对孩子进行排序:我如何按名字对孩子进行排序?》经验,为你挑选了1个好方法。 ... [详细] 如何解决《在perl中指定单个空格分隔符》经验,为你挑选了1个好方法。 ... [详细] 如何解决《更改Select2的默认字体》经验,为你挑选了1个好方法。 ... [详细] 如何解决《如何使用Symfony3目录结构使用Codeception》经验,为你挑选了1个好方法。 ... [详细] 如何解决《RSpec:#RSpec::Core::ExampleGroup::Nested的未定义方法`allow'》经验,为你挑选了1个好方法。 ... [详细] 如何解决《如何在WinRT中清除TimeZoneInfo缓存?》经验,为你挑选了1个好方法。 ... [详细] 如何解决《如何查找列表的一部分是否在str中》经验,为你挑选了1个好方法。 ... [详细] 吐了个 "CAO" !Tags | 热门标签RankList | 热门文章
- 1为什么Java同时具有CountDownLatch和CyclicBarrier?
- 2Visual Studio无法识别ES6模板字符串
- 3无法从Spark Submit中的JAR文件加载主类
- 4番石榴版同时使用火花壳
- 5VBA:崩溃后如何关闭Excel.Application
- 6nonptr-new-declarator中的错误表达
- 7Scikit-学习自定义决策树叶类型
- 8Postgres now()vs'now'in function
- 9如何增加超过10000的图像搜索的谷歌自定义搜索配额?
- 10为什么Python 3.3+ dict排序不仅是未定义的,而且是变量的?
- 11严重:无法访问私钥文件“ /etc/ssl/private/ssl-cert-snakeoil.key”:权限被拒绝
- 12Windows程序存储器与Linux程序存储器
- 13C++从1到非常大的随机数(例如2500万)
- 14R中的"累积差异"功能
- 15在Scala中使用带有Int的"或"运算符
- 16如何将控制台C#应用程序添加到ASP.NET WebSite?
- 17如何在C中检测ESC键?
- 18为什么我的Stack实现中的第98个元素如此奇怪?
- 19嵌套异常的正确方法是什么? - 使用Delphi
- 20无法使用gradle创建RPM
DevBox开发工具箱 | 专业的在线开发工具网站 京公网安备 11010802040832号 | 京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有