https://codesandbox.io/s/jp82jl853v
sportsEditTabContentFooter: {
position: "fixed",
left: 0,
bottom: 0,
width: "100 %",
backgroundColor: "red",
color: "white",
textAlign: "center"
},
<div className={classes.sportsEditTabContentFooter}>
<div>sports Status</div>
<div>
<Button variant="outlined" className={classes.button}>
Cancel
</Button>
<Button
variant="outlined"
onClick={this.savesports}
className={classes.button}
>
Save sports test
</Button>
</div>
</div>
答案 0 :(得分:2)
查看代码后,您似乎尚未对div应用position:sticky。如果添加的话,您应该注意到它粘在您放置的位置。
.RecipeReviewCard-sportsEditTabContentFooter-649 {
left: 0;
width: 100%;
color: white;
bottom: 0;
text-align: center;
background-color: red;
position: sticky;
}