html - 如何在标题上方制作段落层
问题描述
当我们将鼠标悬停在图像上方的标题上时,我正在制作段落数据,该段落将从右侧渐变。这里的代码请帮我写。数据应与右侧对齐,而不是覆盖整个页面此代码
.align-center{
text-align: center;
display: inline-block;
margin:0 auto;
margin-bottom: 50px;
}
.image-cover-3{
margin: 0;
padding: 0;
width: 100%;
height: 250px;
line-height: 250px;
background-size: cover;
text-align: center;
background-image: linear-gradient(rgba(0, 0, 0, 0.7),rgba(100,167,87,.48)), url("https://i.ibb.co/HK8v8W3/buiding.jpg");
}
.head-size-2{
font-size: 40px;
}
.rearrange-img{
display: inline-flex;
vertical-align: middle;
line-height: normal;
position: relative;
color: aliceblue;
}
.image-cover-3:hover .head-size-2{
opacity: 0;
-webkit-transition: opacity 300ms;
-moz-transition: opacity 300ms;
-o-transition: opacity 300ms;
transition: opacity 300ms;
}
.image-cover-3 .head-size-3{
opacity: 0;
font-size: 20px;
display: flex;
vertical-align: middle;
color: aliceblue;
top: -150px;
-webkit-transition: opacity 500ms;
-moz-transition: opacity 500ms;
-o-transition: opacity 500ms;
transition: opacity 500ms;
background-image: linear-gradient(rgba(1, 0, 0, 0.4),rgba(100,167,87,.48));
height: 100%;
width: 1200px;
}
.image-cover-3:hover .head-size-3{
opacity: 0.8;
}
解决方案
欢迎来到 SO!我想这就是你想要的
.align-center{
text-align: center;
display: inline-block;
margin:0 auto;
margin-bottom: 50px;
}
.image-cover-3{
margin: 0;
padding: 0;
width: 100%;
height: 250px;
line-height: 250px;
background-size: cover;
text-align: center;
background-image: linear-gradient(rgba(0, 0, 0, 0.7),rgba(100,167,87,.48)), url("https://i.ibb.co/HK8v8W3/buiding.jpg");
position: relative;
}
.head-size-2{
font-size: 40px;
}
.rearrange-img{
display: inline-flex;
vertical-align: middle;
line-height: normal;
position: relative;
color: aliceblue;
}
.image-cover-3:hover .head-size-2{
opacity: 0;
-webkit-transition: opacity 300ms;
-moz-transition: opacity 300ms;
-o-transition: opacity 300ms;
transition: opacity 300ms;
}
.image-cover-3 .head-size-3{
opacity: 0;
font-size: 20px;
display: flex;
vertical-align: middle;
color: aliceblue;
top: 0px;
-webkit-transition: opacity 500ms;
-moz-transition: opacity 500ms;
-o-transition: opacity 500ms;
transition: opacity 500ms;
background-image: linear-gradient(rgba(1, 0, 0, 0.4),rgba(100,167,87,.48));
height: 100%;
width: 100%;
POSITION: ABSOLUTE;
LEFT: 0;
RIGHT: 0;
align-items: center;
}
.image-cover-3:hover .head-size-3{
opacity: 0.8;
}
<section><div class="image-cover-3">
<h2 class="rearrange-img head-size-2">About the International Confrence on Industry 4.0 & Circular Economy</h2>
<div class="align-center rearrange-img head-size-3">
The conference widens the scope of bringing together innovators, researchers and industries under common goal – creating, evaluating, implementing and benefiting from innovations. It will thus support innovative projects in Mechanical engineering and bring benefits to all involved participants
</div>
</div>
</section>
推荐阅读
- wix - Wix 自定义对话框错误:ICE03:不是有效的外键 Visual Studio 2019
- ios - 如何在 Ax DevTools 中添加全局标签(证明)
- deep-learning - 挥发性物质已被移除,现在没有效果。改用`with torch.no_grad():`
- angular - 从秋田商店查询时,Angular 10 未检测到更改
- java - 如何立即运行 ArrayList.add()?
- object-detection - 尝试实现 cv2.findContours 进行人员检测
- node.js - 如何使用单个索引单独对多个字段进行排序
- asp.net - 消费者会知道 RESTful URL 是基于 OData 还是简单的 RESTful api url?有关系吗?
- c - 可以直接在命令行调用函数吗?
- google-apps-script - Google 表格 - 如何根据多个条件将一行移动到另一张表格?