亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

浮動操作按鈕隱藏在頁腳后面

浮動操作按鈕隱藏在頁腳后面

喵喔喔 2024-01-11 14:16:05
我正在設計一個頁面angular-material,我想在屏幕右下角添加一個聊天按鈕,當我向下滾動頁面時,這個按鈕應該滾動,就像這個網站一樣:http ://harleytherapy.com/我已經完成了大部分部分,即按鈕位于右下角,當我開始滾動頁面時,它也會隨頁面滾動,但唯一的問題是,當我到達底部時,該按鈕位于頁腳后面并變得不可見。當我到達底部時,我希望它保持在頁腳上方。這是我的代碼:<div class="main-content-container">    <button mat-fab class="chat-icon-btn">        <mat-icon class="chat-icon">chat_bubble_outline</mat-icon>    </button>    <h1>Dashboard&nbsp;<mat-icon aria-label="false">dashboard</mat-icon>    </h1>    <!-- Some more content -->    <footer class="footer">        <span>          <a href="#" class="footer-links">Hjem</a><span class="vertical-divider"></span>          <a href="#" class="footer-links">Om </a> <span class="vertical-divider"></span>          <a href="#" class="footer-links"> Hj?lp </a> <span class="vertical-divider"></span>          <a href="#" class="footer-links"> Kontakt os </a> <span class="vertical-divider"></span>          <a href="#" class="footer-links"> Webstedsbetingelser </a> <span class="vertical-divider"></span>          <a href="#" class="footer-links"> Fortrolighedspolitik</a>        </span>      </footer></div>CSS:.main-content-container {    margin-left: 10%;}.chat-icon-btn {    position: fixed;    right: 0;    bottom: 0;    background: #3900B3;    color: #fff;    font-size: 25px;    margin-right: 25px;    margin-bottom: 5px;}.chat-icon {    margin-right: 0px !important;}.footer {    background-color: #3900B3;    padding: 50px 0 50px 0;    position: relative;    text-align: center;    margin-top: 100px;}.footer-links {    color: #fff;    text-decoration: navajowhite;    font-size: 18px;}提前致謝。
查看完整描述

1 回答

?
慕斯709654

TA貢獻1840條經驗 獲得超5個贊

為按鈕提供 z-index,使其位于頁腳頂部。

.chat-icon-btn {
  z-index: 999;
}


查看完整回答
反對 回復 2024-01-11
  • 1 回答
  • 0 關注
  • 149 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號