Html 如何使用bootstrap 3将文本与背景图像底部对齐
看到这个了吗 我想把文字移到图片的底部,因为那里更容易阅读 但我还没有弄明白怎么做。如果我只是在顶部增加利润,那么在手机上,利润就太多了Html 如何使用bootstrap 3将文本与背景图像底部对齐,html,css,twitter-bootstrap-3,Html,Css,Twitter Bootstrap 3,看到这个了吗 我想把文字移到图片的底部,因为那里更容易阅读 但我还没有弄明白怎么做。如果我只是在顶部增加利润,那么在手机上,利润就太多了 <div id="home-section" class="image-bg vertical-align"> <div class="container"> <div class="home-content padding "> <h1 class="jumbo te
<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 h1{
bottom:0;
position:absolute;
}
试试这个-
#home-section h1{
bottom:0;
position:absolute;
}
内容填充使用绝对位置,主div#home部分使用相对位置
#home-section{
position: relative;
}
.home-content{
position: absolute;
bottom:10px;
right:10px;
}
10px是一个基本选项,您可以根据需要将.home内容的底部和右侧调整为任何像素。使用绝对位置填充内容,使用相对位置填充主div#home部分
#home-section{
position: relative;
}
.home-content{
position: absolute;
bottom:10px;
right:10px;
}
10px是一个基本设置,您可以将家庭内容的底部和右侧调整为您想要的任何像素。试试这个
<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;
}
这是标题
#主页{
背景色:#7e90a2;
背景图片:url(https://traken.net/images/bg/home-bg-3.jpg);
颜色:#fff;
高度:900px;
位置:相对位置;
}
家庭内容部{
位置:绝对位置;
底部:10px;
左:0;
右:0;
左边距:自动;
右边距:自动;
}
jsfiddle->试试这个
<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;
}
这是标题
#主页{
背景色:#7e90a2;
背景图片:url(https://traken.net/images/bg/home-bg-3.jpg);
颜色:#fff;
高度:900px;
位置:相对位置;
}
家庭内容部{
位置:绝对位置;
底部:10px;
左:0;
右:0;
左边距:自动;
右边距:自动;
}
jsIDLE->你试过绝对位置和相对位置吗?不,我怎么做?你试过绝对位置和相对位置吗?不,我怎么做?很棒的解决方案!真棒的解决方案!小提琴加1。另外,这一个保持了正确的对中。加上小提琴的1。这一个也保持了对中正确。