日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

css 容器内 div 底部,CSS:在div容器的底部放置一個div容器

發布時間:2024/9/27 247 豆豆
生活随笔 收集整理的這篇文章主要介紹了 css 容器内 div 底部,CSS:在div容器的底部放置一個div容器 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

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: url('../img/infoheader.png') 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 個解決方案

#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: url('../img/infoheader.png') 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: url('../img/infoheader.png') 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;

}

總結

以上是生活随笔為你收集整理的css 容器内 div 底部,CSS:在div容器的底部放置一個div容器的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。