猿问

如何修复材料UI组件中的负边距,并在文本内容中明确显示

我对material-ui组件中的段落有疑问。


我对material-ui组件中的段落有疑问。特定的问题是,当文本超出组件的尺寸时,它不会保留在其中,如图所示。


<Grid container wrap="nowrap"  css={[borde,{

                              maxWidth: 400

                        }]} >

            <Grid item xs css={beneficiosTab}  >

                <Typography 

 >asdadsdasdasdasdasdasdasdasdasdasdasdasdadasdsadasdasdasdsadasdasdsads

                </Typography>

            </Grid>

</Grid>

我希望屏幕上显示的是容器尺寸内的一段


富国沪深
浏览 168回答 1
1回答

慕的地10843

尝试一下style={{wordWrap: 'break-word'}},希望对您有所帮助。谢谢<Grid container wrap="nowrap"&nbsp; css={[borde,{&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; maxWidth: 400&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }]} >&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <Grid item xs css={beneficiosTab}&nbsp; >&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <Typography style={{wordWrap: 'break-word'}}&nbsp;>asdadsdasdasdasdasdasdasdasdasdasdasdasdadasdsadasdasdasdsadasdasdsads&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </Typography>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </Grid></Grid>
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答