第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

Material UI 如何設(shè)置網(wǎng)格元素垂直跨3行?

Material UI 如何設(shè)置網(wǎng)格元素垂直跨3行?

九州編程 2023-10-17 16:00:07
這似乎是一個(gè)基本問題,但在 Material UI 的官方文檔中沒有如何實(shí)現(xiàn)這一點(diǎn)的示例。我嘗試過嵌套網(wǎng)格,但右側(cè)的網(wǎng)格元素不會(huì)跨越垂直空間。我嘗試過align-items =“stretch”。下面是屏幕截圖和我的代碼。感謝您的任何建議!return (<Container>  <Box>    <Typography>Test</Typography>  </Box>  <Grid container spacing={3} direction="row" justify="center" alignItems="stretch">    <Grid item xs={12}>      <Paper className={classes.paper}>xs=12</Paper>    </Grid>    <Grid item xs={6} spacing={3}>      <Grid>        <Card className={classes.root} variant="outlined">          <CardContent>          <Typography className={classes.title} color="textSecondary" gutterBottom>            Customer Profile          </Typography>          <Typography variant="h5" component="h2">            Sarah Doria          </Typography>          <Typography className={classes.pos} color="textSecondary">            Position          </Typography>          <Typography variant="body2" component="p">            Company            <br />            {'"a benevolent smile"'}          </Typography>          </CardContent>          <CardActions>            <Button size="small">Learn More</Button>          </CardActions>        </Card>    </Grid>
查看完整描述

1 回答

?
幕布斯7119047

TA貢獻(xiàn)1794條經(jīng)驗(yàn) 獲得超8個(gè)贊

只需添加height 100%卡片和網(wǎng)格


<Grid style={{ height: "100%" }}>


<Card style={{ height: "100%" }}>

import React from "react";

import "./styles.css";

import {

  Grid,

  Typography,

  Container,

  Box,

  Paper,

  Card,

  CardContent,

  CardActions,

  Button

} from "@material-ui/core";


const YourCard = () => {

  const classes = {};

  return (

    <Card

      className={classes.root}

      variant="outlined"

      style={{ height: "100%" }}

    >

      <CardContent>

        <Typography

          className={classes.title}

          color="textSecondary"

          gutterBottom

        >

          Customer Profile

        </Typography>

        <Typography variant="h5" component="h2">

          Sarah Doria

        </Typography>

        <Typography className={classes.pos} color="textSecondary">

          Position

        </Typography>

        <Typography variant="body2" component="p">

          Company

          <br />

          {'"a benevolent smile"'}

        </Typography>

      </CardContent>

      <CardActions>

        <Button size="small">Learn More</Button>

      </CardActions>

    </Card>

  );

};


export default function App() {

  const classes = {};

  return (

    <Container>

      <Box>

        <Typography>Test</Typography>

      </Box>

      <Grid

        container

        spacing={3}

        direction="row"

        justify="center"

        alignItems="stretch"

      >

        <Grid item xs={12}>

          <Paper className={classes.paper}>xs=12</Paper>

        </Grid>

        <Grid item xs={6}>

          <Grid container spacing={3}>

            <Grid item xs={12}>

              <YourCard />

            </Grid>

            <Grid item xs={12}>

              <YourCard />

            </Grid>

            <Grid item xs={12}>

              <YourCard />

            </Grid>

          </Grid>

        </Grid>

        <Grid item xs={6}>

          <Grid style={{ height: "100%" }}>

            <YourCard />

          </Grid>

        </Grid>

      </Grid>

    </Container>

  );

}

https://img1.sycdn.imooc.com/652e3f60000117bd06490741.jpg

查看完整回答
反對(duì) 回復(fù) 2023-10-17
  • 1 回答
  • 0 關(guān)注
  • 113 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)