我如何在材料UI中响应段落?
我是材料UI的新手,我有一个完整的页面,这些内容充满了反应式的内容,我必须做出响应迅速。我以前做过小的网格和盒子,但没有这个规模。例如,我真的不知道如何使整个段落完全出现在手机上。
<div style={{ padding: "10px" }}></div>
<Box sx={{ flexGrow: 1 }} display="flex"
justifyContent="center"
alignItems="center" marginLeft={8} marginRight={1} mt={4}>
<Grid container spacing={{ xs: 1, md: 2, }} columns={{ xs: 2, sm: 2, md: 12 }} display="flex"
justifyContent="center"
alignItems="center" >
<Grid container >
<Grid item id="about" xs={12} >
<Grid sx={{ bgcolor: "linear-gradient( 111.6deg, rgba(174,68,223,1) 27.3%, rgba(246,135,135,1) 112.7% )", boxShadow: 5, borderBottom: 1, borderColor: "radial-gradient(90% 100% at 50% 0%, #2d685a 0%, #050606 100%), radial-gradient(90% 100% at 50% 0%, #a86487 0%, #827878 100%), radial-gradient(110% 215% at 100% 0%, #000AFF 0%, #3A5525 100%), linear-gradient(230deg, #000 0%, #09FF04 100%), linear-gradient(130deg, #2D2929 0%, #C4B6FB 100%)" }}>
<Typography variant="h1" fontWeight="600" padding="10px" margin="15px" fontSize="22px" align="left">
{companyData.name}
<span style={{ color: color, marginLeft: "20px", fontWeight: "600" }} >{companyData.changepct}%</span>
{companyData.changepct > 0 ? <ArrowUpwardIcon style={{ color: "green", height: "100%" }} /> : <ArrowDownwardIcon fontSize="medium" style={{ color: "red", height: "100%" }} />}
</Typography>
</Grid >
<div style={{ padding: "10px" }}></div>
<Typography component="h4" align="left" style={{ marginLeft: "15px", width: "95%" }}>
{abtCompany.slice(0, 400)}
{value}
</Typography>
<div style={{ padding: "10px" }}></div>
<Grid item id="general-information" xs={12}>
<Grid sx={{ boxShadow: 5, borderBottom: 1, borderColor: "radial-gradient(90% 100% at 50% 0%, #2d685a 0%, #050606 100%), radial-gradient(90% 100% at 50% 0%, #a86487 0%, #827878 100%), radial-gradient(110% 215% at 100% 0%, #000AFF 0%, #3A5525 100%), linear-gradient(230deg, #000 0%, #09FF04 100%), linear-gradient(130deg, #2D2929 0%, #C4B6FB 100%)" }}>
<Typography variant="h4" fontWeight="600" paddingBottom="10px" paddingTop="10px" margin="15px" fontSize="22px" align="left">General Information</Typography></Grid>
<div style={{ padding: "10px" }}></div>
<Grid container>
<Grid item xs={6} style={{ borderRight: "1px dashed rgba(124, 126, 140, 0.5)" }}>
<Grid item xs={12} style={{ margin: "10px", textAlign: "left" }}>
<span style={{ margin: "5px", color: "#7c7e8c" }}>CEO</span>
<span style={{ fontWeight: "600", margin: "5px", float: "right" }}>{companyData.ceo}</span>
</Grid>
<Grid item xs={12} style={{ margin: "10px", textAlign: "left" }}>
<span style={{ margin: "5px", color: "#7c7e8c" }}>Founded</span>
<span style={{ fontWeight: "600", margin: "5px", float: "right" }}>{companyData.founded}</span>
</Grid>
<Grid item xs={12} style={{ margin: "10px", textAlign: "left" }}>
<span style={{ margin: "5px", color: "#7c7e8c" }}>Headquarters</span>
<span style={{ fontWeight: "600", margin: "5px", float: "right" }}>{companyData.hq}</span>
</Grid>
</Grid>
<Grid item xs={6}>
<Grid item xs={12} style={{ margin: "10px", textAlign: "left", marginTop: "15px" }}>
<span style={{ margin: "5px", color: "#7c7e8c" }}>Industry</span>
<span style={{ fontWeight: "600", margin: "5px", float: "right" }}>{companyData.industry}</span>
</Grid>
<Grid item xs={12} style={{ margin: "10px", textAlign: "left" }}>
<span style={{ margin: "5px", color: "#7c7e8c" }}>Sector</span>
<span style={{ fontWeight: "600", margin: "5px", float: "right" }}>{companyData.sector}</span>
</Grid>
</Grid>
</Grid>
</Grid>
加载该页面时,看起来像这样。 。
这。
感谢任何帮助。
I am new to Material UI and I have a page full of unresponsive content that I have to make responsive. I have made small grids and boxes responsive before, but nothing of this scale. I don't really know how to make an entire paragraph appear fully on a phone for example.
<div style={{ padding: "10px" }}></div>
<Box sx={{ flexGrow: 1 }} display="flex"
justifyContent="center"
alignItems="center" marginLeft={8} marginRight={1} mt={4}>
<Grid container spacing={{ xs: 1, md: 2, }} columns={{ xs: 2, sm: 2, md: 12 }} display="flex"
justifyContent="center"
alignItems="center" >
<Grid container >
<Grid item id="about" xs={12} >
<Grid sx={{ bgcolor: "linear-gradient( 111.6deg, rgba(174,68,223,1) 27.3%, rgba(246,135,135,1) 112.7% )", boxShadow: 5, borderBottom: 1, borderColor: "radial-gradient(90% 100% at 50% 0%, #2d685a 0%, #050606 100%), radial-gradient(90% 100% at 50% 0%, #a86487 0%, #827878 100%), radial-gradient(110% 215% at 100% 0%, #000AFF 0%, #3A5525 100%), linear-gradient(230deg, #000 0%, #09FF04 100%), linear-gradient(130deg, #2D2929 0%, #C4B6FB 100%)" }}>
<Typography variant="h1" fontWeight="600" padding="10px" margin="15px" fontSize="22px" align="left">
{companyData.name}
<span style={{ color: color, marginLeft: "20px", fontWeight: "600" }} >{companyData.changepct}%</span>
{companyData.changepct > 0 ? <ArrowUpwardIcon style={{ color: "green", height: "100%" }} /> : <ArrowDownwardIcon fontSize="medium" style={{ color: "red", height: "100%" }} />}
</Typography>
</Grid >
<div style={{ padding: "10px" }}></div>
<Typography component="h4" align="left" style={{ marginLeft: "15px", width: "95%" }}>
{abtCompany.slice(0, 400)}
{value}
</Typography>
<div style={{ padding: "10px" }}></div>
<Grid item id="general-information" xs={12}>
<Grid sx={{ boxShadow: 5, borderBottom: 1, borderColor: "radial-gradient(90% 100% at 50% 0%, #2d685a 0%, #050606 100%), radial-gradient(90% 100% at 50% 0%, #a86487 0%, #827878 100%), radial-gradient(110% 215% at 100% 0%, #000AFF 0%, #3A5525 100%), linear-gradient(230deg, #000 0%, #09FF04 100%), linear-gradient(130deg, #2D2929 0%, #C4B6FB 100%)" }}>
<Typography variant="h4" fontWeight="600" paddingBottom="10px" paddingTop="10px" margin="15px" fontSize="22px" align="left">General Information</Typography></Grid>
<div style={{ padding: "10px" }}></div>
<Grid container>
<Grid item xs={6} style={{ borderRight: "1px dashed rgba(124, 126, 140, 0.5)" }}>
<Grid item xs={12} style={{ margin: "10px", textAlign: "left" }}>
<span style={{ margin: "5px", color: "#7c7e8c" }}>CEO</span>
<span style={{ fontWeight: "600", margin: "5px", float: "right" }}>{companyData.ceo}</span>
</Grid>
<Grid item xs={12} style={{ margin: "10px", textAlign: "left" }}>
<span style={{ margin: "5px", color: "#7c7e8c" }}>Founded</span>
<span style={{ fontWeight: "600", margin: "5px", float: "right" }}>{companyData.founded}</span>
</Grid>
<Grid item xs={12} style={{ margin: "10px", textAlign: "left" }}>
<span style={{ margin: "5px", color: "#7c7e8c" }}>Headquarters</span>
<span style={{ fontWeight: "600", margin: "5px", float: "right" }}>{companyData.hq}</span>
</Grid>
</Grid>
<Grid item xs={6}>
<Grid item xs={12} style={{ margin: "10px", textAlign: "left", marginTop: "15px" }}>
<span style={{ margin: "5px", color: "#7c7e8c" }}>Industry</span>
<span style={{ fontWeight: "600", margin: "5px", float: "right" }}>{companyData.industry}</span>
</Grid>
<Grid item xs={12} style={{ margin: "10px", textAlign: "left" }}>
<span style={{ margin: "5px", color: "#7c7e8c" }}>Sector</span>
<span style={{ fontWeight: "600", margin: "5px", float: "right" }}>{companyData.sector}</span>
</Grid>
</Grid>
</Grid>
</Grid>
On loading that page looks like this.
Whereas I want it to appear at least not all zoomed in like this.
Any help is appreciated thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
中添加以下标签
如果您使用create-react-app ,则在您使用next.js
。 em>
有关更多信息,请访问此处
Add the following tag in your index.html if you're using create-react-app
If you are using Next.js add the following code in the relevant file inside the pages directory
Head tag will go inside return statement
For more information please visit here