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

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

如何在Material ui中對齊屏幕底部的項目

如何在Material ui中對齊屏幕底部的項目

瀟湘沐 2023-10-17 16:58:35
我正在嘗試在屏幕末尾對齊按鈕,這樣即使我滾動背景列表,按鈕仍應保留在屏幕底部。我嘗試過但無法弄清楚這一點。請任何人幫助我這樣做。這就是我的屏幕的樣子?,F在,滾動時它總是出現在屏幕中間。這是我的代碼<Link to={"/checkout-summary"}>          <div className="checkoutbtn">            <Button              style={{                boxShadow: "none",                borderRadius: "0px",                position: 'absolute',                bottom: 0              }}              variant="contained"              color="primary"            >              Check Out            </Button>          </div>        </Link>
查看完整描述

2 回答

?
幕布斯6054654

TA貢獻1876條經驗 獲得超7個贊

將頁腳固定到底部


import { makeStyles } from '@material-ui/core/styles';


const useStyles = makeStyles(theme => ({

  footer: {

    position: 'fixed',

    bottom: 0,

    width: '100%',

    height: 60,

    textAlign: 'center'

  }

}));


const classes = useStyles();


<Link to={"/checkout-summary"} className={classes.footer}>


查看完整回答
反對 回復 2023-10-17
?
神不在的星期二

TA貢獻1963條經驗 獲得超6個贊

import { styled } from '@mui/system';

    

const MyMessageBox = styled('div')({

    position: 'fixed',

    bottom: 0,

    width: '100%',

    height: 60,

    textAlign: 'center',

});

      

<MyMessageBox>Contents inside this will be shown at the bottom of the page</MyMessageBox>



查看完整回答
反對 回復 2023-10-17
  • 2 回答
  • 0 關注
  • 115 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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