我正在嘗試在屏幕末尾對齊按鈕,這樣即使我滾動背景列表,按鈕仍應保留在屏幕底部。我嘗試過但無法弄清楚這一點。請任何人幫助我這樣做。這就是我的屏幕的樣子?,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}>

神不在的星期二
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>
- 2 回答
- 0 關注
- 115 瀏覽
添加回答
舉報
0/150
提交
取消