- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我在使用 boostrap 卡的小型设备上遇到问题。我正在使用悬停效果来滑动内容。但在小型设备上,内容会影响图像。我真的不知道如何使用 position: absolute 使内容直接在图像之后开始。我只想看到名字和标题。当鼠标悬停时,其余内容会以向上滑动的方式显示。
.team-card {
border:0!important;
border-radius:5px!important;
overflow:hidden!important;
}
.team-card .card-body .card-title,.team-card .card-body .card-text {
text-align:center;
margin:0;
}
.team-card .card-body {
position:absolute;
width:100%;
height:100%;
left:0;
top:255px;
background-color:#fff;
-moz-transition:all .3s ease-in-out;
-o-transition:all .3s ease-in-out;
-webkit-transition:all .3s ease-in-out;
transition:all .3s ease-in-out
}
.team-card .card-body p {
line-height:1.6em;
}
.team-card:hover .card-body {
top:0;
}
.team-card .card-body .card-text {
margin-bottom:15px;
}
<html>
<head><link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" />
</head>
<body>
<div class="card team-card">
<img src="https://png.pngtree.com/png-vector/20190704/ourlarge/pngtree-vector-user-young-boy-avatar-icon-png-image_1538408.jpg" class="card-img-top" alt="">
<div class="card-body">
<h5 class="card-title">John Doe</h5>
<p class="card-text">Business Director</p>
<p>Board member (core-team) previous Director-Business Development at EM6 and earlier at Syncada.</p>
</div>
</div>
</body>
</html
感谢您的帮助。
最佳答案
您看到此行为是因为您对 .team-card .card-body
类的 top
属性使用了绝对数字;我们可以做的是分配以下内容:top:calc(100% - 89px);
这是 card-body
的完整高度,我们删除 89px 这是card-title
和 card-text
的高度...
下面的工作片段:
.team-card {
border: 0!important;
border-radius: 5px!important;
overflow: hidden!important;
}
.team-card .card-body .card-title,
.team-card .card-body .card-text {
text-align: center;
margin: 0;
}
.team-card .card-body {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: calc(100% - 89px);
background-color: #fff;
-moz-transition: all .3s ease-in-out;
-o-transition: all .3s ease-in-out;
-webkit-transition: all .3s ease-in-out;
transition: all .3s ease-in-out
}
.team-card .card-body p {
line-height: 1.6em;
}
.team-card:hover .card-body {
top: 0;
}
.team-card .card-body .card-text {
margin-bottom: 15px;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<div class="card team-card">
<img src="https://png.pngtree.com/png-vector/20190704/ourlarge/pngtree-vector-user-young-boy-avatar-icon-png-image_1538408.jpg" class="card-img-top" alt="">
<div class="card-body">
<h5 class="card-title">John Doe</h5>
<p class="card-text">Business Director</p>
<p>Board member (core-team) previous Director-Business Development at EM6 and earlier at Syncada.</p>
</div>
</div>
关于html - 小型设备上的引导卡问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58259356/
我正在尝试使用中介包在 R 中进行中介分析。我查看了有关如何执行此操作的文档,并通读了 R 提供的示例(即,我已经运行了“example(mediate)”)。尽管如此,我还是无法运行最简单的中介。理
我在我的应用程序中引导 View 时遇到问题。 我试图在 bootstrap 中获取 View 实例,以便我可以分配 View 变量等。 问题是我似乎无法按照推荐的方式来做。我可以做这个: $this
我已经遵循了几个有关运行 RMI 应用程序的教程。但是,我似乎无法使其工作,因为我一直陷入相同的错误:ClassNotFoundException。我知道这个错误意味着我将文件放在了错误的位置,但我尝
最后,我开始与 Aurelia 合作。有一个入门套件可用 Here这有助于初始化 Aurelia。但它是一个模板,应该在网站模板中使用。 我有一个预配置 WebApi项目,我想在其中使用 Aureli
对于回归问题,我有一个训练数据集: - 3个具有高斯分布的变量 - 20 个均匀分布的变量。 我的所有变量都是连续的,在 [0;1] 之间。 问题是用于对我的回归模型进行评分的测试数据对所有变量具有均
我正在尝试“拉伸(stretch)”或扩展第 1 列中的 A 部分以填充该行的高度。 1行2列: +---------------------+---------------------+ |
已关闭。此问题旨在寻求有关书籍、工具、软件库等的建议。不符合Stack Overflow guidelines .它目前不接受答案。 我们不允许提问寻求书籍、工具、软件库等的推荐。您可以编辑问题,以
我正在使用 bootstrap 4 填充功能。默认情况下,bootstrap4 中的 col 或 col-12 类在左右应用 15px 填充。我想为移动设备设置左右padding 0,所以我使用下面的
我正在尝试通过自己编写引导加载程序来引导 linux 内核,但不知道如何加载内核。 所有人都在说使用 int 13h 将扇区从硬盘加载到内存。 其中部门应该加载??加载扇区后怎么办? 如果可以的话,请
如何合并两者以创建垂直菜单?我有一个基本的路由设置(它可以工作并呈现为标准的水平菜单): Home Gallery Contact 从 react-bootst
我的应用程序中有一些状态来自服务器并且不会更改(在用户 session 的生命周期内)。此状态在 HTML 中引导。 我应该将它合并到 reducer 中作为商店的一部分吗?const bootstr
有没有办法使用 styled-components与 react-bootstrap 一起? React-bootstrap 为其组件公开了 bsClass 属性而不是 className ,这似乎与
除了 YouTube 播放器的大小之外,以下代码运行良好。我无法将其调整为我想要的大小。 我试着把 width="150"和 height="100"在 iframe 但什么也没发生。
我正在尝试使这个东西与 this one 相同。我已经打印了。但崩溃消耗不起作用。 @foreach($faqs as $faq)
我想在启动 Play 应用程序时运行一些代码。这似乎不起作用。有什么线索吗? public class Global extends GlobalSettings { @Override
我了解监督学习和无监督学习之间的区别: 监督学习是一种使用标记数据“教导”分类器的方法。 无监督学习让分类器“自行学习”,例如使用聚类。 但是什么是“弱监督学习”?它如何对示例进行分类? 最佳答案 更
我对 python 还是很陌生,所以请原谅我,如果这是非常简单的或非常错误的思考方式。 我安装了 python 2.7。根据我在运行以下代码时的理解,它列出了它查找模块的目录。 Python 2.7.
我想使用 bootstrap carousel 制作一个 slider ,但我的 slider 不滑动即使我点击按钮也不会滑动 我测试了很多其他的 bootstrap slider ,我也遇到了同样的
我正在尝试通过替换 base 形状为 (4,2) 的 2D numpy 数组按行进行采样,比如 10 次。最终输出应该是一个 3D numpy 数组。 尝试了下面的代码,它有效。但是有没有不用 for
我是 Bootstrap 的新手,现在我正在检查它的 slider 功能。简单的 slider 和动画效果 - 一切正常。 但是我看不懂,我可以做这样的东西吗? - http://www.owlcar
我是一名优秀的程序员,十分优秀!