DEV Community

kaede
kaede

Posted on • Updated on

React Mui PC でもスマフォでも中央揃えで縦長の枠を作る

CRA と mui で作成

import {
  Card,
} from '@material-ui/core/';


function App() {
  return (
    <Card
      variant="outlined"
      style={{
        minWidth: 300,
        maxWidth: 300,
        minHeight: 640,
        marginLeft: 'auto',
        marginRight: 'auto',
        marginTop: 30,
      }}
    > in card text
    </Card>
  );
}

export default App;
Enter fullscreen mode Exit fullscreen mode

直接スタイルを当てた。

===

PC

Image description

===

iPhone X (devtool)

Image description

Top comments (0)