我正在尝试使用 React 和 flexbox。通常我可以在 react native 中使用 flexbox 但在 react.js 中无法实现
这是我的 CSS 文件
.wrapper, html, body {
height:100%;
margin:0;
position:absolute;
}
.wrapper {
display: flex;
flex-direction: column;
}
.nav {
background-color: red;
flex:1
}
.main {
background-color: blue;
flex:1
}
这是我的js文件
import React, { Component } from 'react';
import './background.css';
import { Icon } from 'semantic-ui-react'
import Navbar from './navbar'
class Back extends Component {
render() {
return (
<div className="wrapper">
<div className="nav"></div>
<div className="main"></div>
</div>
);
}
}
export default Back;
我只有一个白屏,这可能是什么问题?
谢谢