Html 文本覆盖图像(css)
这真令人沮丧!如何使Html 文本覆盖图像(css),html,css,Html,Css,这真令人沮丧!如何使位于图像底部,而不是文本底部 人工智能与区块链利益 每天学习更多关于以太坊和其他区块链技术的知识 也许是这样 将替换为,并将图像用作该div的背景 包括该div中的h2 将位置:相对应用于div 对h2应用position:absolute,因为定位了绝对定位的元素 在相对于其最近位置的祖先的指定位置 () .header img{ 位置:相对位置; 背景:url('https://image.ibb.co/haP17k/umbrella.jpg“)中心不重复/1
位于图像底部,而不是文本底部
人工智能与区块链利益
每天学习更多关于以太坊和其他区块链技术的知识
也许是这样
- 将
替换为
,并将图像用作该div的背景
- 包括该div中的h2
- 将
位置:相对应用于div
- 对h2应用
position:absolute
,因为定位了绝对定位的元素
在相对于其最近位置的祖先的指定位置
()
.header img{
位置:相对位置;
背景:url('https://image.ibb.co/haP17k/umbrella.jpg“)中心不重复/100%100%;
高度:300px;
宽度:300px;
}
氢{
位置:绝对位置;
底部:0;
左:0;
右:0;
保证金:0自动;
}
人工智能与区块链利益
每天学习更多关于以太坊和其他区块链技术的知识
也许是这样
- 将
替换为
,并将图像用作该div的背景
- 包括该div中的h2
- 将
位置:相对应用于div
- 对h2应用
position:absolute
,因为定位了绝对定位的元素
在相对于其最近位置的祖先的指定位置
()
.header img{
位置:相对位置;
背景:url('https://image.ibb.co/haP17k/umbrella.jpg“)中心不重复/100%100%;
高度:300px;
宽度:300px;
}
氢{
位置:绝对位置;
底部:0;
左:0;
右:0;
保证金:0自动;
}
人工智能与区块链利益
每天学习更多关于以太坊和其他区块链技术的知识
删除h2上的绝对位置,为什么要绝对定位?因此图像底部的文本设置为正数,即100px而不是0Fixed:)谢谢!删除h2上的绝对位置,为什么要绝对定位?因此图像底部的文本设置为正数,即100px而不是0Fixed:)谢谢!
<div class="col-lg-4">
<div class="header-link">
<img src="https://image.ibb.co/haP17k/umbrella.jpg" width="300" height="auto" alt="umbrella" border="0">
<h2>Artificial Intelligence & Blockchain Interest</h2>
</div>
<p>Learning more every day about Ethereum and other blockchain technologies!</p>
<p><a class="btn btn-primary" href="#" role="button">View details »</a></p>
</div>
</div>
人工智能与区块链利益
每天学习更多关于以太坊和其他区块链技术的知识
替换为
,并将图像用作该div的背景位置:相对应用于div
position:absolute
,因为定位了绝对定位的元素.header img{
位置:相对位置;
背景:url('https://image.ibb.co/haP17k/umbrella.jpg“)中心不重复/100%100%;
高度:300px;
宽度:300px;
}
氢{
位置:绝对位置;
底部:0;
左:0;
右:0;
保证金:0自动;
}
人工智能与区块链利益
每天学习更多关于以太坊和其他区块链技术的知识
替换为
,并将图像用作该div的背景位置:相对应用于div
position:absolute
,因为定位了绝对定位的元素.header img{
位置:相对位置;
背景:url('https://image.ibb.co/haP17k/umbrella.jpg“)中心不重复/100%100%;
高度:300px;
宽度:300px;
}
氢{
位置:绝对位置;
底部:0;
左:0;
右:0;
保证金:0自动;
}
人工智能与区块链利益
每天学习更多关于以太坊和其他区块链技术的知识
<div class="col-lg-4">
<div class="header-link">
<img src="https://image.ibb.co/haP17k/umbrella.jpg" width="300" height="auto" alt="umbrella" border="0">
<h2>Artificial Intelligence & Blockchain Interest</h2>
</div>
<p>Learning more every day about Ethereum and other blockchain technologies!</p>
<p><a class="btn btn-primary" href="#" role="button">View details »</a></p>
</div>
</div>