我创建了一个页脚并将其放在 app.jsx 文件中以显示在每个页面上。但是,如果页面上的内容没有占据整个页面,页脚就会浮起来。我需要更新 index.html 吗?
页脚:
<Grid container spacing={2} className={classes.container}>
<Grid xs={12}>
<a href='https://twitter.com/loremipsum'>
<SocialIcons>
<FaTwitter className={classes.icon} />
</SocialIcons>
</a>
<a href='https://www.facebook.com/loremipsum'>
<SocialIcons>
<FaFacebookSquare className={classes.icon} />
</SocialIcons>
</a>
<a href='https://www.linkedin.com/company/loremipsum'>
<SocialIcons>
<FaLinkedin className={classes.icon} />
</SocialIcons>
</a>
</Grid>
</Grid>
页脚样式:
export const useStyles = makeStyles({
container: {
backgroundColor: 'black',
color: '#F5F5F5',
borderTop: '5px solid #669999',
marginTop: 20,
},
icon: {
width: 20,
height: 20,
color: '#669999',
marginTop: 10,
marginBottom: 10,
marginLeft: 10,
marginRight: 10,
},
});
export const SocialIcons = styled.div`
transition: transform 250ms;
display: inline-block;
&:hover {
transform: translateY(-2px);
}
`;
Index.html 正文
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
</body>
繁花如伊
30秒到达战场
相关分类