如何在材料UI中的盒子组件中添加标题?
目前有两个盒子看起来像这样。我希望像标题一样在数字上放心。我对材料UI相对陌生。我感谢您如何将盒子前进的任何帮助。
两个框的代码:
<Grid item sm={6}>
<Box component="span" sx={{ p: 2, border: 3,borderColor: 'error.main' }}>
Nifty
<Grid component="span" sx={{ p: 2}}> {row.data.price}</Grid>
</Box>
</Grid>
<Grid item sm={6}>
<Box component="span" sx={{ p: 2, border: 3,borderColor: 'error.main' }}>
Sensex
<Grid component="span" sx={{ p: 2}}> {row.data.price}</Grid>
</Box>
</Grid>
谢谢。
Two boxes currently look like this. I would like Nifty on top of the number like a heading. I'm relatively new to Material UI. I'd appreciate any help regarding how I can give heading to my boxes.
The code for the 2 boxes:
<Grid item sm={6}>
<Box component="span" sx={{ p: 2, border: 3,borderColor: 'error.main' }}>
Nifty
<Grid component="span" sx={{ p: 2}}> {row.data.price}</Grid>
</Box>
</Grid>
<Grid item sm={6}>
<Box component="span" sx={{ p: 2, border: 3,borderColor: 'error.main' }}>
Sensex
<Grid component="span" sx={{ p: 2}}> {row.data.price}</Grid>
</Box>
</Grid>
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
添加
display:'inline-block'
到您的box
,然后更改 span top
在您的价格中Add
display: 'inline-block'
to yourBox
and changespan
top
in your price这是您要寻找的吗?
Would this be what you are looking for?