css
css 容器内 div 底部,css:在div容器的底部放置一個div容器 -凯发ag旗舰厅登录网址下载
my intention is to place a div-container inside a div-container, but it isn't working atm. my div-container which should be placed at the bottom sticks to the bottom of the whole page.
我的意圖是在div容器中放置一個div容器,但它不能正常工作。我應該放在底部的div容器粘在整個頁面的底部。
.info-container {
display: flex;
margin: 0 0 0 auto;
max-width: 450px;
max-height: 400px;
width: 100%;
height: 100%;
box-shadow: 0px 0px 38px 0px rgba(0, 0, 0, 0.36);
background-color: yellow;
}
div.info-header {
position: relative;
display: flex;
flex-direction: column;
width: 470px;
background: no-repeat;
background-position: auto auto;
height: 100px;
box-sizing: border-box;
}
div.info-header h3 {
font-family: 'signpanter', sans-serif !important;
text-decoration: none;
font-size: 32px;
color: white;
font-weight: 200;
text-shadow: 1px 1px #747474;
text-align: center;
}
div.info-bottom-text:hover {
color: white;
text-shadow: 1px 1px #747474;
}
.info-bottom {
display: flex;
align-items: flex-end;
position: absolute;
bottom: 0px;
}
los santos international airport
ss
sss
between the header and footer of the div should be a content div which isn't implemented yet.
在div的頁眉和頁腳之間應該是一個尚未實現的內容div。
would be nice if someone can help me with my issue! thanks in advance.
如果有人可以幫我解決我的問題會很好!提前致謝。
3 个凯发ag旗舰厅登录网址下载的解决方案
#1
2
the trick is to wrap everything inside of a relatively-positioned element that is a direct child of the outer .info-container.
訣竅是將所有內容包裝在一個相對定位的元素中,該元素是外部.info-container的直接子元素。
this can be seen in the following, in which i've created the class info-wrapper with the simple rule position: relative.
這可以在下面看到,其中我用簡單的規則位置:relative創建了類info-wrapper。
.info-container {
display: flex;
margin: 0 0 0 auto;
max-width: 450px;
max-height: 400px;
width: 100%;
height: 100%;
box-shadow: 0px 0px 38px 0px rgba(0, 0, 0, 0.36);
background-color: yellow;
}
div.info-header {
position: relative;
display: flex;
flex-direction: column;
width: 470px;
background: no-repeat;
background-position: auto auto;
height: 100px;
box-sizing: border-box;
}
div.info-header h3 {
font-family: 'signpanter', sans-serif !important;
text-decoration: none;
font-size: 32px;
color: white;
font-weight: 200;
text-shadow: 1px 1px #747474;
text-align: center;
}
div.info-bottom-text:hover {
color: white;
text-shadow: 1px 1px #747474;
}
.info-bottom {
display: flex;
align-items: flex-end;
position: absolute;
bottom: 0px;
}
.info-wrapper {
position: relative;
}
los santos international airport
ss
sss
#2
3
set for outer div set stlye as
設置為外部div set stlye as
position: relative;
for the inner div set style as
對於內部div設置樣式為
position: absolute;
bottom: 0;
#3
2
info-container should have position: relative
info-container應該有位置:relative
.info-container {
position: relative;
display: flex;
margin: 0 0 0 auto;
max-width: 450px;
max-height: 400px;
width: 100%;
height: 100%;
box-shadow: 0px 0px 38px 0px rgba(0, 0, 0, 0.36);
background-color: yellow;
}
div.info-header {
position: relative;
display: flex;
flex-direction: column;
width: 470px;
background: no-repeat;
background-position: auto auto;
height: 100px;
box-sizing: border-box;
}
div.info-header h3 {
font-family: 'signpanter', sans-serif !important;
text-decoration: none;
font-size: 32px;
color: white;
font-weight: 200;
text-shadow: 1px 1px #747474;
text-align: center;
}
div.info-bottom-text:hover {
color: white;
text-shadow: 1px 1px #747474;
}
.info-bottom {
display: flex;
align-items: flex-end;
position: absolute;
bottom: 0px;
}
总结
以上是凯发ag旗舰厅登录网址下载为你收集整理的css 容器内 div 底部,css:在div容器的底部放置一個div容器的全部内容,希望文章能够帮你解决所遇到的问题。
如果觉得凯发ag旗舰厅登录网址下载网站内容还不错,欢迎将凯发ag旗舰厅登录网址下载推荐给好友。
- 上一篇:
- 下一篇: