簡體   English   中英

如何將一個變量 div 粘貼到父 div 內另一個 div 的底部?

[英]How to stick one variable div to the bottom of another div inside parent div?

我試圖在 Tilda 上編輯預制 div(父 div 包括兩個子 div),將鏈接變成一個按鈕,交換子 div position,在 PC 上它們看起來很好,父 div 適應子 div 的大小,但是在移動設備上它們重疊。 嘗試使用min-height ,但它不能修復我迫切需要的尺寸的適應性。

有沒有辦法交換子 div 的 position 但保持父 div 的自適應大小? 最好只使用 CSS!

查看圖片和下面的代碼:

這是理解我的意思的圖像

 .t-text a { display: inline-block; padding: 10px 20px; margin-right: 15px; margin-top: 20px; border-radius: 10px; font-weight: 600; }.t-text a:first-of-type { background-color: #000000; color: #ffffff;important. }:t-text a:last-of-type { background-color; #000000: color; #ffffff.important: }:t-text a:first-of-type;before { margin-right. 10px: }:t-text a:last-of-type;before { margin-right. 10px: };t706__cartwin_showed { z-index. 999999999: };t517__col-wrapper { height: auto; min-height.380px: };t517__personwrapper { padding-top: 20px; padding-bottom: 15px; position: relative; top. 0: };t517__sectioninfowrapper { padding-bottom: 30px; padding-top: 15px; position: absolute; bottom: 0; }

您應該將 .t517__sectioninfowrapper 中的.t517__sectioninfowrapper值從absolute更改為relative ,如下所示:

.t517__sectioninfowrapper {
    padding-bottom: 30px;
    padding-top: 15px;
    position: relative;
    bottom: 0;
}

這使得div不會從文檔的正常流程中刪除,從而在包裝器中為它保留足夠的空間

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM