gpt4 book ai didi

html - 如何使用 bootstrap 3 将文本对齐到背景图像的底部

转载 作者:太空宇宙 更新时间:2023-11-03 22:24:42 32 4
gpt4 key购买 nike

查看此 gist

我想将文字移到图片底部,这样更容易阅读。

但我还没有想出如何做到这一点。如果我只是在顶部添加边距,那么在移动设备上,边距就太多了。

<div id="home-section" class="image-bg vertical-align">
<div class="container">
<div class="home-content padding ">

<h1 class="jumbo text-center"><em>This is the headline</em></h1>
<div class="button text-center">
<a href="/signup"" onclick="log('click','register','home-section')" class="btn btn-primary btn-animated">Start Free Trail</a>
</div>
</div>
</div><!--/#home-section-->

CSS

#home-section {
background-color:#7e90a2;
background-image:url(https://traken.net/images/bg/home-bg-3.jpg);
color:#fff;
height:900px;

最佳答案

试试这个

<div id="home-section" class="image-bg vertical-align">
<div class="container">
<div class="home-content padding ">

<h1 class="jumbo text-center"><em>This is the headline</em></h1>
<div class="button text-center">
<a href="/signup"" onclick="log('click','register','home-section')" class="btn btn-primary btn-animated">Start Free Trail</a>
</div>
</div>
</div><!--/#home-section-->

#home-section {
background-color:#7e90a2;
background-image:url(https://traken.net/images/bg/home-bg-3.jpg);
color:#fff;
height:900px;
position:relative;
}
div.home-content {
position:absolute;
bottom:10px;
left: 0;
right: 0;
margin-left: auto;
margin-right: auto;
}

jsfiddle -> https://jsfiddle.net/aq9Laaew/145890/

关于html - 如何使用 bootstrap 3 将文本对齐到背景图像的底部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51784229/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com