我有以下两个组成部分:
class ParentComponent extends React.Component {
return (
<div>
I am Div 1
</div>
<Child Component />
)
}
ChildComponent具有另一个div:
class ChildComponent extends React.Component {
return (
<div>
I am Div 2
</div>
)
}
我想水平对齐Div 1和Div 2。我该如何实现?
答案 0 :(得分:0)
class ParentComponent extends React.Component {
return (
<div className="container">
<div>
I am Div 1
</div>
<Child Component />
</div>
)
}
.container {
display:flex;
}